Package org.teiid.metadata
Class PureZipFileSystem
- java.lang.Object
-
- org.teiid.metadata.PureZipFileSystem
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.jboss.vfs.spi.FileSystem
public final class PureZipFileSystem extends Object implements org.jboss.vfs.spi.FileSystem
This implementation is backed by a zip file. The provided file must be owned by this instance; otherwise, if the file disappears unexpectedly, the filesystem will malfunction.
- Author:
- David M. Lloyd, Ales Justin
-
-
Constructor Summary
Constructors Constructor Description PureZipFileSystem(File archiveFile)Create a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleandelete(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)booleanexists(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)CodeSigner[]getCodeSigners(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)List<String>getDirectoryEntries(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)FilegetFile(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)longgetLastModified(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)FilegetMountSource()URIgetRootURI()longgetSize(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)booleanisDirectory(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)booleanisFile(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)booleanisReadOnly()static org.jboss.vfs.VirtualFilemount(URL url)InputStreamopenInputStream(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)
-
-
-
Constructor Detail
-
PureZipFileSystem
public PureZipFileSystem(File archiveFile) throws IOException
Create a new instance.- Parameters:
archiveFile- the original archive file- Throws:
IOException- if an I/O error occurs
-
-
Method Detail
-
mount
public static org.jboss.vfs.VirtualFile mount(URL url) throws IOException, URISyntaxException
- Throws:
IOExceptionURISyntaxException
-
getFile
public File getFile(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target) throws IOException
- Specified by:
getFilein interfaceorg.jboss.vfs.spi.FileSystem- Throws:
IOException
-
openInputStream
public InputStream openInputStream(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target) throws IOException
- Specified by:
openInputStreamin interfaceorg.jboss.vfs.spi.FileSystem- Throws:
IOException
-
delete
public boolean delete(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
deletein interfaceorg.jboss.vfs.spi.FileSystem
-
getSize
public long getSize(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
getSizein interfaceorg.jboss.vfs.spi.FileSystem
-
getLastModified
public long getLastModified(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
getLastModifiedin interfaceorg.jboss.vfs.spi.FileSystem
-
exists
public boolean exists(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
existsin interfaceorg.jboss.vfs.spi.FileSystem
-
isFile
public boolean isFile(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
isFilein interfaceorg.jboss.vfs.spi.FileSystem
-
isDirectory
public boolean isDirectory(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)- Specified by:
isDirectoryin interfaceorg.jboss.vfs.spi.FileSystem
-
getDirectoryEntries
public List<String> getDirectoryEntries(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)
- Specified by:
getDirectoryEntriesin interfaceorg.jboss.vfs.spi.FileSystem
-
getCodeSigners
public CodeSigner[] getCodeSigners(org.jboss.vfs.VirtualFile mountPoint, org.jboss.vfs.VirtualFile target)
- Specified by:
getCodeSignersin interfaceorg.jboss.vfs.spi.FileSystem
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceorg.jboss.vfs.spi.FileSystem
-
getMountSource
public File getMountSource()
- Specified by:
getMountSourcein interfaceorg.jboss.vfs.spi.FileSystem
-
getRootURI
public URI getRootURI() throws URISyntaxException
- Specified by:
getRootURIin interfaceorg.jboss.vfs.spi.FileSystem- Throws:
URISyntaxException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.jboss.vfs.spi.FileSystem- Throws:
IOException
-
-