public void close() throws IOException { this.locations = null; for (Archive archive : this.archivesCache.values()) { archive.close(); } }
@Override public void flush() throws IOException { for (Archive archive : this.archivesCache.values()) { archive.flush(); } }
public Set<String> allPackages() { if (this.packagesCache == null) { this.initialize(); } return this.packagesCache.keySet(); }
for (String packageName : archive.allPackages()) { if (packageName.startsWith(key)) { ArrayList<String> types = archive.getTypes(packageName); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(packageName + typeName, this.charset)); ArrayList<String> types = archive.getTypes(key); if (types != null) { for (String typeName : types) { final Kind kind = getKind(typeName); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(normalizedPackageName + typeName, this.charset));
if (archive.contains(normalizedFileName)) { return archive.getArchiveFileObject(normalizedFileName, this.charset);
private Archive getArchive(File f) { // check the archive (jar/zip) cache Archive archive = this.archivesCache.get(f); if (archive == null) { archive = Archive.UNKNOWN_ARCHIVE; // create a new archive if (f.exists()) { try { archive = new Archive(f); } catch (ZipException e) { // ignore } catch (IOException e) { // ignore } if (archive != null) { this.archivesCache.put(f, archive); } } this.archivesCache.put(f, archive); } return archive; }
@Override public boolean contains(Location location, FileObject fo) throws IOException { validateFileObject(fo); Iterable<? extends File> files = getLocation(location); if (files == null) { throw new IllegalArgumentException("Unknown location : " + location);//$NON-NLS-1$ } for (File file : files) { if (file.isDirectory()) { if (fo instanceof EclipseFileObject) { Path filepath = ((EclipseFileObject) fo).f.toPath(); if (filepath.startsWith(Paths.get(file.toURI()).toAbsolutePath())) { return true; } } } else if (isArchive(file)) { if (fo instanceof ArchiveFileObject) { Archive archive = getArchive(file); if (archive != Archive.UNKNOWN_ARCHIVE) { if (archive.contains(((ArchiveFileObject) fo ).entryName)) { return true; } } } } } return false; }
for (String packageName : archive.allPackages()) { if (packageName.startsWith(key)) { ArrayList<String> types = archive.getTypes(packageName); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(packageName + typeName, this.charset)); ArrayList<String> types = archive.getTypes(key); if (types != null) { for (String typeName : types) { final Kind kind = getKind(typeName); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(normalizedPackageName + typeName, this.charset));
if (archive.contains(normalizedFileName)) { return archive.getArchiveFileObject(normalizedFileName, this.charset);
private Archive getArchive(File f) { // check the archive (jar/zip) cache Archive archive = this.archivesCache.get(f); if (archive == null) { archive = Archive.UNKNOWN_ARCHIVE; // create a new archive if (f.exists()) { try { archive = new Archive(f); } catch (ZipException e) { // ignore } catch (IOException e) { // ignore } if (archive != null) { this.archivesCache.put(f, archive); } } this.archivesCache.put(f, archive); } return archive; }
for (String packageName : archive.allPackages()) { if (packageName.startsWith(key)) { List<String> types = archive.getTypes(packageName); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(packageName + typeName, this.charset)); List<String> types = archive.getTypes(key); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(key + typeName, this.charset));
if (archive.contains(normalizedFileName)) { return archive.getArchiveFileObject(normalizedFileName, this.charset);
public Archive(File file) throws ZipException, IOException { this.file = file; this.zipFile = new ZipFile(file); initialize(); }
public void close() throws IOException { this.locations = null; for (Archive archive : this.archivesCache.values()) { archive.close(); } }
public void flush() throws IOException { for (Archive archive : this.archivesCache.values()) { archive.flush(); } }
private Archive getArchive(File f) { // check the archive (jar/zip) cache Archive archive = this.archivesCache.get(f); if (archive == null) { archive = Archive.UNKNOWN_ARCHIVE; // create a new archive if (f.exists()) { try { archive = new Archive(f); } catch (ZipException e) { // ignore } catch (IOException e) { // ignore } if (archive != null) { this.archivesCache.put(f, archive); } } this.archivesCache.put(f, archive); } return archive; }
for (String packageName : archive.allPackages()) { if (packageName.startsWith(key)) { List<String> types = archive.getTypes(packageName); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(packageName + typeName, this.charset)); List<String> types = archive.getTypes(key); if (types != null) { for (String typeName : types) { final Kind kind = getKind(getExtension(typeName)); if (kinds.contains(kind)) { collector.add(archive.getArchiveFileObject(key + typeName, this.charset));
if (archive.contains(normalizedFileName)) { return archive.getArchiveFileObject(normalizedFileName, this.charset);
public Archive(File file) throws ZipException, IOException { this.file = file; this.zipFile = new ZipFile(file); initialize(); }
public void close() throws IOException { this.locations = null; for (Archive archive : this.archivesCache.values()) { archive.close(); } }