Skip to content

Commit

Permalink
Address comments from @svanoort
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Jun 14, 2017
1 parent 4498570 commit c0fe4b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ private void addUserFiles(File rootDir, List<File> filesToBackup) throws Periodi
File usersDir = new File(rootDir, "users");
if (usersDir.exists() && usersDir.isDirectory()) {
// Each user directory should have a config.xml file
File[] dirsInUsers = usersDir.listFiles((FileFilter) FileFilterUtils.directoryFileFilter());
if (dirsInUsers == null) {
// First one may happen only due to the race condition
throw new PeriodicBackupException("Job directory path does not denote or there is an I/O error");
}

File[] dirsInUsers = Util.listFiles(usersDir, FileFilterUtils.directoryFileFilter());
for (File user : dirsInUsers) {
File userConfig = new File(user, "config.xml");
if (userConfig.exists() && userConfig.isFile()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static File[] listFiles(@Nonnull File directory, @CheckForNull FileFilter
try {
files = fileFilter == null ? directory.listFiles() : directory.listFiles(fileFilter);
} catch(SecurityException ex) {
throw new PeriodicBackupException(formatMessage(directory, "Securiy exception while listing files"), ex);
throw new PeriodicBackupException(formatMessage(directory, "Security exception while listing files"), ex);
}

if (files == null) {
Expand Down

0 comments on commit c0fe4b4

Please sign in to comment.