< prev index next >

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

Print this page




 216         ListBuffer<Path> entries = new ListBuffer<>();
 217         for (String s: searchPath.split(Pattern.quote(File.pathSeparator), -1)) {
 218             if (s.isEmpty()) {
 219                 if (emptyPathDefault != null) {
 220                     entries.add(emptyPathDefault);
 221                 }
 222             } else {
 223                 try {
 224                     entries.add(getPath(s));
 225                 } catch (IllegalArgumentException e) {
 226                     if (warn) {
 227                         log.warning(LintCategory.PATH, Warnings.InvalidPath(s));
 228                     }
 229                 }
 230             }
 231         }
 232         return entries;
 233     }
 234 
 235     public void setMultiReleaseValue(String multiReleaseValue) {
 236         fsEnv = Collections.singletonMap("multi-release", multiReleaseValue);
 237     }
 238 
 239     private boolean contains(Collection<Path> searchPath, Path file) throws IOException {
 240 
 241         if (searchPath == null) {
 242             return false;
 243         }
 244 
 245         Path enclosingJar = null;
 246         if (file.getFileSystem().provider() == fsInfo.getJarFSProvider()) {
 247             URI uri = file.toUri();
 248             if (uri.getScheme().equals("jar")) {
 249                 String ssp = uri.getSchemeSpecificPart();
 250                 int sep = ssp.lastIndexOf("!");
 251                 if (ssp.startsWith("file:") && sep > 0) {
 252                     enclosingJar = Paths.get(URI.create(ssp.substring(0, sep)));
 253                 }
 254             }
 255         }
 256 




 216         ListBuffer<Path> entries = new ListBuffer<>();
 217         for (String s: searchPath.split(Pattern.quote(File.pathSeparator), -1)) {
 218             if (s.isEmpty()) {
 219                 if (emptyPathDefault != null) {
 220                     entries.add(emptyPathDefault);
 221                 }
 222             } else {
 223                 try {
 224                     entries.add(getPath(s));
 225                 } catch (IllegalArgumentException e) {
 226                     if (warn) {
 227                         log.warning(LintCategory.PATH, Warnings.InvalidPath(s));
 228                     }
 229                 }
 230             }
 231         }
 232         return entries;
 233     }
 234 
 235     public void setMultiReleaseValue(String multiReleaseValue) {
 236         fsEnv = Collections.singletonMap("releaseVersion", multiReleaseValue);
 237     }
 238 
 239     private boolean contains(Collection<Path> searchPath, Path file) throws IOException {
 240 
 241         if (searchPath == null) {
 242             return false;
 243         }
 244 
 245         Path enclosingJar = null;
 246         if (file.getFileSystem().provider() == fsInfo.getJarFSProvider()) {
 247             URI uri = file.toUri();
 248             if (uri.getScheme().equals("jar")) {
 249                 String ssp = uri.getSchemeSpecificPart();
 250                 int sep = ssp.lastIndexOf("!");
 251                 if (ssp.startsWith("file:") && sep > 0) {
 252                     enclosingJar = Paths.get(URI.create(ssp.substring(0, sep)));
 253                 }
 254             }
 255         }
 256 


< prev index next >