Ejemplo n.º 1
0
 /** Set the list of source directories. */
 void setSourceBaseList(Iterable<String> sourceBaseList) {
   for (String repos : sourceBaseList) {
     if (repos.endsWith(".zip") || repos.endsWith(".jar") || repos.endsWith(".z0p.gz")) {
       // Zip or jar archive
       try {
         if (repos.startsWith("http:")
             || repos.startsWith("https:")
             || repos.startsWith("file:")) {
           String url = SystemProperties.rewriteURLAccordingToProperties(repos);
           repositoryList.add(makeInMemorySourceRepository(url));
         } else repositoryList.add(new ZipSourceRepository(new ZipFile(repos)));
       } catch (IOException e) {
         // Ignored - we won't use this archive
         AnalysisContext.logError("Unable to load " + repos, e);
       }
     } else {
       File dir = new File(repos);
       if (dir.canRead() && dir.isDirectory())
         repositoryList.add(new DirectorySourceRepository(repos));
       else {
         AnalysisContext.logError("Unable to load " + repos);
       }
     }
   }
 }