/** {@inheritDoc} */ public File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); final JarEntry zipEntry = zipNode.entry; try { return new File(new URI("jar", archiveFile.toURI().toString() + "!/", zipEntry.getName())); } catch (URISyntaxException e) { throw new IOException(e); } }
/** * {@inheritDoc} */ public CodeSigner[] getCodeSigners(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return null; } JarEntry jarEntry = zipNode.entry; return jarEntry.getCodeSigners(); }
final Closeable c = VFS.mount(root, new PureZipFileSystem(f));
final ZipNode rootNode = new ZipNode(new HashMap<String, ZipNode>(), "", null); FILES: for (JarEntry entry : iter(entries)) { final String name = entry.getName(); final boolean isDirectory = entry.isDirectory();
public static IndexVDB loadMetadata(String vdbName, URL url) throws IOException, MalformedURLException { VirtualFile root; try { root = PureZipFileSystem.mount(url); } catch (URISyntaxException e) { throw new IOException(e); } IndexVDB result = new IndexVDB(); result.resources = new VDBResources(root, null); IndexMetadataRepository store = new IndexMetadataRepository(); result.store = store.load(SystemMetadata.getInstance().getDataTypes(), result.resources); return result; } }
final Closeable c = VFS.mount(root, new PureZipFileSystem(f));
final ZipNode rootNode = new ZipNode(new HashMap<String, ZipNode>(), "", null); FILES: for (JarEntry entry : iter(entries)) { final String name = entry.getName(); final boolean isDirectory = entry.isDirectory();
VirtualFile root = PureZipFileSystem.mount(url); VDBMetaData metadata;
/** {@inheritDoc} */ public long getLastModified(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return 0L; } final JarEntry entry = zipNode.entry; return entry == null ? zipTime : entry.getTime(); }
/** {@inheritDoc} */ public File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); final JarEntry zipEntry = zipNode.entry; try { return new File(new URI("jar", archiveFile.toURI().toString() + "!/", zipEntry.getName())); } catch (URISyntaxException e) { throw new IOException(e); } }
final Closeable c = VFS.mount(root, new PureZipFileSystem(f));
final ZipNode rootNode = new ZipNode(new HashMap<String, ZipNode>(), "", null); FILES: for (JarEntry entry : iter(entries)) { final String name = entry.getName(); final boolean isDirectory = entry.isDirectory();
/** {@inheritDoc} */ public long getLastModified(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return 0L; } final JarEntry entry = zipNode.entry; return entry == null ? zipTime : entry.getTime(); }
/** {@inheritDoc} */ public File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); final JarEntry zipEntry = zipNode.entry; try { return new File(new URI("jar", archiveFile.toURI().toString() + "!/", zipEntry.getName())); } catch (URISyntaxException e) { throw new IOException(e); } }
/** {@inheritDoc} */ public long getSize(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return 0L; } final JarEntry entry = zipNode.entry; if (zipNode == rootNode) { return archiveFile.length(); } return entry == null ? 0L : entry.getSize(); }
/** {@inheritDoc} */ public InputStream openInputStream(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); if (rootNode == zipNode) { return new FileInputStream(archiveFile); } final JarEntry entry = zipNode.entry; if (entry == null) { throw new IOException("Not a file: \"" + target.getPathName() + "\""); } return zipFile.getInputStream(entry); }
/** {@inheritDoc} */ public List<String> getDirectoryEntries(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return Collections.emptyList(); } final Map<String, ZipNode> children = zipNode.children; if (children == null) { return Collections.emptyList(); } final Collection<ZipNode> values = children.values(); final List<String> names = new ArrayList<String>(values.size()); for (ZipNode node : values) { names.add(node.name); } return names; }
/** {@inheritDoc} */ public InputStream openInputStream(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); if (rootNode == zipNode) { return new FileInputStream(archiveFile); } final JarEntry entry = zipNode.entry; if (entry == null) { throw new IOException("Not a file: \"" + target.getPathName() + "\""); } return zipFile.getInputStream(entry); }
/** {@inheritDoc} */ public List<String> getDirectoryEntries(VirtualFile mountPoint, VirtualFile target) { final ZipNode zipNode = getZipNode(mountPoint, target); if (zipNode == null) { return Collections.emptyList(); } final Map<String, ZipNode> children = zipNode.children; if (children == null) { return Collections.emptyList(); } final Collection<ZipNode> values = children.values(); final List<String> names = new ArrayList<String>(values.size()); for (ZipNode node : values) { names.add(node.name); } return names; }
/** {@inheritDoc} */ public InputStream openInputStream(VirtualFile mountPoint, VirtualFile target) throws IOException { final ZipNode zipNode = getExistingZipNode(mountPoint, target); if (rootNode == zipNode) { return new FileInputStream(archiveFile); } final JarEntry entry = zipNode.entry; if (entry == null) { throw new IOException("Not a file: \"" + target.getPathName() + "\""); } return zipFile.getInputStream(entry); }