/** * 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); } } } }
/** * 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); } } } }
loadFromURL = SystemProperties.rewriteURLAccordingToProperties(loadFromURL); URL url = new URL(loadFromURL); mainFrame.getMainFrameLoadSaveHelper().loadAnalysis(url);