Skip to content

Commit

Permalink
sa
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Jan 25, 2025
1 parent 14870f9 commit cff0889
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/serverutils/task/backup/ThreadBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,15 @@ private static void addBaseFolderFiles(List<File> files, File saveFile) {
pattern = pattern.replace("$WORLDNAME", saveName);

int firstWildcardIndex = pattern.indexOf('*');
if (firstWildcardIndex == -1)
{
if (firstWildcardIndex == -1) {
files.addAll(FileUtils.listTree(new File(pattern)));
continue;
}

Path rootFolder = Paths.get(pattern.substring(0, firstWildcardIndex));
Path rootFolder = Paths.get(pattern.substring(0, firstWildcardIndex));

// If wildcard was not at the start of a directory, get the parent
if (firstWildcardIndex != 0 && (pattern.charAt(firstWildcardIndex-1) != '/'))
{
if (firstWildcardIndex != 0 && (pattern.charAt(firstWildcardIndex - 1) != '/')) {
rootFolder = rootFolder.getParent();
}

Expand Down

0 comments on commit cff0889

Please sign in to comment.