< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java

Print this page
rev 2988 : JDK-8058150


 314             return;
 315         }
 316 
 317         if (!Files.exists(d)) {
 318            return;
 319         }
 320 
 321         if (!caseMapCheck(d, subdirectory)) {
 322             return;
 323         }
 324 
 325         java.util.List<Path> files;
 326         try (Stream<Path> s = Files.list(d)) {
 327             files = (sortFiles == null ? s : s.sorted(sortFiles)).collect(Collectors.toList());
 328         } catch (IOException ignore) {
 329             return;
 330         }
 331 
 332         for (Path f: files) {
 333             String fname = f.getFileName().toString();


 334             if (Files.isDirectory(f)) {
 335                 if (recurse && SourceVersion.isIdentifier(fname)) {
 336                     listDirectory(directory,
 337                                   new RelativeDirectory(subdirectory, fname),
 338                                   fileKinds,
 339                                   recurse,
 340                                   resultList);
 341                 }
 342             } else {
 343                 if (isValidFile(fname, fileKinds)) {
 344                     JavaFileObject fe =
 345                         new RegularFileObject(this, fname, d.resolve(fname));
 346                     resultList.append(fe);
 347                 }
 348             }
 349         }
 350     }
 351 
 352     /**
 353      * Insert all files in subdirectory subdirectory of archive archive




 314             return;
 315         }
 316 
 317         if (!Files.exists(d)) {
 318            return;
 319         }
 320 
 321         if (!caseMapCheck(d, subdirectory)) {
 322             return;
 323         }
 324 
 325         java.util.List<Path> files;
 326         try (Stream<Path> s = Files.list(d)) {
 327             files = (sortFiles == null ? s : s.sorted(sortFiles)).collect(Collectors.toList());
 328         } catch (IOException ignore) {
 329             return;
 330         }
 331 
 332         for (Path f: files) {
 333             String fname = f.getFileName().toString();
 334             if (fname.endsWith("/"))
 335                 fname = fname.substring(0, fname.length() - 1);
 336             if (Files.isDirectory(f)) {
 337                 if (recurse && SourceVersion.isIdentifier(fname)) {
 338                     listDirectory(directory,
 339                                   new RelativeDirectory(subdirectory, fname),
 340                                   fileKinds,
 341                                   recurse,
 342                                   resultList);
 343                 }
 344             } else {
 345                 if (isValidFile(fname, fileKinds)) {
 346                     JavaFileObject fe =
 347                         new RegularFileObject(this, fname, d.resolve(fname));
 348                     resultList.append(fe);
 349                 }
 350             }
 351         }
 352     }
 353 
 354     /**
 355      * Insert all files in subdirectory subdirectory of archive archive


< prev index next >