2929import java .io .File ;
3030import java .io .FileFilter ;
3131import java .io .FilenameFilter ;
32+ import java .io .IOException ;
3233import java .io .OutputStream ;
3334import java .nio .charset .StandardCharsets ;
3435import java .nio .file .FileVisitResult ;
@@ -153,7 +154,7 @@ public void testAgeFilter() throws Exception {
153154 }
154155
155156 @ Test
156- public void testAnd () {
157+ public void testAnd () throws IOException {
157158 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
158159 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
159160 assertFiltering (trueFilter .and (trueFilter ), new File ("foo.test" ), true );
@@ -163,7 +164,7 @@ public void testAnd() {
163164 }
164165
165166 @ Test
166- public void testAnd2 () {
167+ public void testAnd2 () throws IOException {
167168 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
168169 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
169170 assertFiltering (new AndFileFilter (trueFilter , trueFilter ), new File ("foo.test" ), true );
@@ -181,7 +182,7 @@ public void testAnd2() {
181182 }
182183
183184 @ Test
184- public void testAndArray () {
185+ public void testAndArray () throws IOException {
185186 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
186187 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
187188 assertFiltering (new AndFileFilter (trueFilter , trueFilter , trueFilter ), new File ("foo.test" ), true );
@@ -252,7 +253,7 @@ public void testCanWrite() throws Exception {
252253 }
253254
254255 @ Test
255- public void testDelegateFileFilter () {
256+ public void testDelegateFileFilter () throws IOException {
256257 final OrFileFilter orFilter = new OrFileFilter ();
257258 final File testFile = new File ("test.txt" );
258259
@@ -276,7 +277,7 @@ public void testDelegation() { // TODO improve these tests
276277
277278 @ SuppressWarnings ("deprecation" )
278279 @ Test
279- public void testDeprecatedWildcard () {
280+ public void testDeprecatedWildcard () throws IOException {
280281 IOFileFilter filter = new WildcardFilter ("*.txt" );
281282 final List <String > patternList = Arrays .asList ("*.txt" , "*.xml" , "*.gif" );
282283 final IOFileFilter listFilter = new WildcardFilter (patternList );
@@ -355,7 +356,7 @@ public void testDeprecatedWildcard() {
355356 }
356357
357358 @ Test
358- public void testDirectory () {
359+ public void testDirectory () throws IOException {
359360 // XXX: This test presumes the current working dir is the base dir of the source checkout.
360361 final IOFileFilter filter = new DirectoryFileFilter ();
361362
@@ -432,7 +433,7 @@ public void testEnsureTestCoverage() {
432433 }
433434
434435 @ Test
435- public void testFalse () {
436+ public void testFalse () throws IOException {
436437 final IOFileFilter filter = FileFilterUtils .falseFileFilter ();
437438 assertFiltering (filter , new File ("foo.test" ), false );
438439 assertFiltering (filter , new File ("foo.test" ).toPath (), false );
@@ -447,13 +448,13 @@ public void testFalse() {
447448 }
448449
449450 @ Test
450- public void testFileEqualsFilter () {
451+ public void testFileEqualsFilter () throws IOException {
451452 assertFooBarFileFiltering (
452453 new FileEqualsFileFilter (new File ("foo" )).or (new FileEqualsFileFilter (new File ("bar" ))));
453454 }
454455
455456 @ Test
456- public void testFileFilterUtils_and () {
457+ public void testFileFilterUtils_and () throws IOException {
457458 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
458459 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
459460 assertFiltering (FileFilterUtils .and (trueFilter , trueFilter , trueFilter ), new File ("foo.test" ), true );
@@ -463,7 +464,7 @@ public void testFileFilterUtils_and() {
463464 }
464465
465466 @ Test
466- public void testFileFilterUtils_or () {
467+ public void testFileFilterUtils_or () throws IOException {
467468 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
468469 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
469470 final File testFile = new File ("foo.test" );
@@ -474,7 +475,7 @@ public void testFileFilterUtils_or() {
474475 }
475476
476477 @ Test
477- public void testFiles () {
478+ public void testFiles () throws IOException {
478479 // XXX: This test presumes the current working dir is the base dir of the source checkout.
479480 final IOFileFilter filter = FileFileFilter .INSTANCE ;
480481
@@ -700,7 +701,7 @@ public void testFilterSetNullParameters() {
700701 }
701702
702703 @ Test
703- public void testHidden () {
704+ public void testHidden () throws IOException {
704705 final File hiddenDirFile = new File (SVN_DIR_NAME );
705706 final Path hiddenDirPath = hiddenDirFile .toPath ();
706707 if (hiddenDirFile .exists ()) {
@@ -797,8 +798,6 @@ public void testMagicNumberFileFilterBytesOffset() throws Exception {
797798 assertFiltering (filter , dir , false );
798799 }
799800
800- // -----------------------------------------------------------------------
801-
802801 @ Test
803802 public void testMagicNumberFileFilterString () throws Exception {
804803 final byte [] classFileMagicNumber = {(byte ) 0xCA , (byte ) 0xFE , (byte ) 0xBA , (byte ) 0xBE };
@@ -1037,7 +1036,7 @@ public void testMakeSVNAware() throws Exception {
10371036 }
10381037
10391038 @ Test
1040- public void testNameFilter () {
1039+ public void testNameFilter () throws IOException {
10411040 assertFooBarFileFiltering (new NameFileFilter ("foo" , "bar" ));
10421041 }
10431042
@@ -1061,7 +1060,7 @@ public void testNameFilterNullListArgument() {
10611060 }
10621061
10631062 @ Test
1064- public void testNegate () {
1063+ public void testNegate () throws IOException {
10651064 final IOFileFilter filter = FileFilterUtils .notFileFilter (FileFilterUtils .trueFileFilter ());
10661065 assertFiltering (filter , new File ("foo.test" ), false );
10671066 assertFiltering (filter , new File ("foo" ), false );
@@ -1077,7 +1076,7 @@ public void testNullFilters() {
10771076 }
10781077
10791078 @ Test
1080- public void testOr () {
1079+ public void testOr () throws IOException {
10811080 final IOFileFilter trueFilter = TrueFileFilter .INSTANCE ;
10821081 final IOFileFilter falseFilter = FalseFileFilter .INSTANCE ;
10831082 final File testFile = new File ("foo.test" );
@@ -1124,13 +1123,13 @@ public void testOr() {
11241123 }
11251124
11261125 @ Test
1127- public void testPathEqualsFilter () {
1126+ public void testPathEqualsFilter () throws IOException {
11281127 assertFooBarFileFiltering (
11291128 new PathEqualsFileFilter (Paths .get ("foo" )).or (new PathEqualsFileFilter (Paths .get ("bar" ))));
11301129 }
11311130
11321131 @ Test
1133- public void testPrefix () {
1132+ public void testPrefix () throws IOException {
11341133 IOFileFilter filter = new PrefixFileFilter ("foo" , "bar" );
11351134 final File testFile = new File ("test" );
11361135 final Path testPath = testFile .toPath ();
@@ -1194,7 +1193,7 @@ public void testPrefix() {
11941193 }
11951194
11961195 @ Test
1197- public void testPrefixCaseInsensitive () {
1196+ public void testPrefixCaseInsensitive () throws IOException {
11981197
11991198 IOFileFilter filter = new PrefixFileFilter (new String [] {"foo" , "bar" }, IOCase .INSENSITIVE );
12001199 assertFiltering (filter , new File ("foo.test1" ), true );
@@ -1323,7 +1322,7 @@ public void testSizeFilterOnPaths() throws Exception {
13231322 }
13241323
13251324 @ Test
1326- public void testSuffix () {
1325+ public void testSuffix () throws IOException {
13271326 IOFileFilter filter = new SuffixFileFilter ("tes" , "est" );
13281327 final File testFile = new File ("test" );
13291328 final Path testPath = testFile .toPath ();
@@ -1380,7 +1379,7 @@ public void testSuffix() {
13801379 }
13811380
13821381 @ Test
1383- public void testSuffixCaseInsensitive () {
1382+ public void testSuffixCaseInsensitive () throws IOException {
13841383
13851384 IOFileFilter filter = new SuffixFileFilter (new String [] {"tes" , "est" }, IOCase .INSENSITIVE );
13861385 assertFiltering (filter , new File ("foo.tes" ), true );
@@ -1414,7 +1413,7 @@ public void testSuffixCaseInsensitive() {
14141413 }
14151414
14161415 @ Test
1417- public void testTrue () {
1416+ public void testTrue () throws IOException {
14181417 final IOFileFilter filter = FileFilterUtils .trueFileFilter ();
14191418 assertFiltering (filter , new File ("foo.test" ), true );
14201419 assertFiltering (filter , new File ("foo" ), true );
0 commit comments