mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 15:06:00 +00:00
NIFI-1051: Fixed checkstyle violations
This commit is contained in:
parent
7a73867c46
commit
abf2c62884
@ -309,12 +309,12 @@ public class FileSystemRepository implements ContentRepository {
|
||||
// the path already exists, so scan the path to find any files and update maxIndex to the max of
|
||||
// all filenames seen.
|
||||
Files.walkFileTree(realPath, new SimpleFileVisitor<Path>() {
|
||||
|
||||
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
|
||||
LOG.warn("Content repository contains un-readable file or directory '" + file.getFileName() + "'. Skipping. ", exc);
|
||||
return FileVisitResult.SKIP_SUBTREE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
|
||||
LOG.warn("Content repository contains un-readable file or directory '" + file.getFileName() + "'. Skipping. ", exc);
|
||||
return FileVisitResult.SKIP_SUBTREE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
|
||||
if (attrs.isDirectory()) {
|
||||
|
@ -71,23 +71,23 @@ public class TestFileSystemRepository {
|
||||
public void shutdown() throws IOException {
|
||||
repository.shutdown();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBogusFile() throws IOException {
|
||||
repository.shutdown();
|
||||
System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
|
||||
|
||||
repository.shutdown();
|
||||
System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
|
||||
|
||||
File bogus = new File(rootFile, "bogus");
|
||||
try {
|
||||
bogus.mkdir();
|
||||
bogus.setReadable(false);
|
||||
|
||||
repository = new FileSystemRepository();
|
||||
repository.initialize(new StandardResourceClaimManager());
|
||||
} finally {
|
||||
bogus.setReadable(true);
|
||||
assertTrue(bogus.delete());
|
||||
}
|
||||
bogus.mkdir();
|
||||
bogus.setReadable(false);
|
||||
|
||||
repository = new FileSystemRepository();
|
||||
repository.initialize(new StandardResourceClaimManager());
|
||||
} finally {
|
||||
bogus.setReadable(true);
|
||||
assertTrue(bogus.delete());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user