public class ZipFileObject extends FileObject
Modifier | Constructor and Description |
---|---|
protected |
ZipFileObject(ZipFileSystem zfs,
java.util.zip.ZipEntry zipEntry,
ZipFileObject par)
Create a new
ZipFileObject . |
protected |
ZipFileObject(ZipFileSystem zfs,
java.util.zip.ZipEntry zipEntry,
ZipFileObject par,
java.lang.String name)
Create a new
ZipFileObject with the specified name. |
Modifier and Type | Method and Description |
---|---|
protected void |
addChildObject(ZipFileObject child) |
boolean |
canRead()
returns true if the file can be read by the client.
|
boolean |
exists()
returns true if the file exists.
|
java.nio.channels.ReadableByteChannel |
getChannel(ProgressMonitor monitor)
opens a Channel, perhaps transferring the file to a local cache first.
|
FileObject[] |
getChildren()
returns objects within a folder.
|
java.io.File |
getFile(ProgressMonitor monitor)
gets a File object that can be opened by the client.
|
java.io.InputStream |
getInputStream(ProgressMonitor monitor)
opens an inputStream, perhaps transferring the file to a
cache first.
|
java.lang.String |
getNameExt()
returns the canonical name of the file within the filesystem.
|
FileObject |
getParent()
returns the parent FileObject (a folder).
|
long |
getSize()
returns the size of the file.
|
boolean |
isData()
returns true if the file is a data file that to be used
reading or writing data.
|
boolean |
isFolder()
indicates the type of FileObject
|
boolean |
isLocal()
returns true if the file is locally available, meaning clients can
call getFile() and the readable File reference will be available in
interactive time.
|
boolean |
isReadOnly()
true is the file is read-only.
|
boolean |
isRoot()
returns true if this is the root of the filesystem it came from.
|
java.util.Date |
lastModified()
returns the Date when the file was last modified.
|
getCapability, getChannel, getFile, getInputStream, removeLocalFile
protected ZipFileObject(ZipFileSystem zfs, java.util.zip.ZipEntry zipEntry, ZipFileObject par)
ZipFileObject
.zfs
- the containing ZipFileSystem
zipEntry
- the ZipEntry
associated with this objectpar
- the parent ZipFileObject
. Set to null if this is the root object.protected ZipFileObject(ZipFileSystem zfs, java.util.zip.ZipEntry zipEntry, ZipFileObject par, java.lang.String name)
ZipFileObject
with the specified name. The name
should normally not be specified. However, a folder which contains only a single
folder will not have a corresponding ZipEntry
. In that case, zipEntry
should be set to null
and the name
set to the
name of this folder, with no path information slashes.zfs
- the containing ZipFileSystemzipEntry
- the ZipEntry
associated with this objectpar
- the parent ZipFileObject. Set to null if this is the root object.name
- the file name. If zipEntry
is not
null
, this is ignored.protected void addChildObject(ZipFileObject child)
public boolean canRead()
FileObject
canRead
in class FileObject
public FileObject[] getChildren() throws java.io.IOException
FileObject
getChildren
in class FileObject
java.io.IOException
public java.io.InputStream getInputStream(ProgressMonitor monitor) throws java.io.IOException
FileObject
getInputStream
in class FileObject
monitor
- for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException
- if the file doesn't exist.java.io.IOException
public java.nio.channels.ReadableByteChannel getChannel(ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
FileObject
getChannel
in class FileObject
monitor
- for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException
- if the file doesn't exist.java.io.IOException
public java.io.File getFile(ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
FileObject
getFile
in class FileObject
monitor
- for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException
- if the file doesn't exist.java.io.IOException
- if the file cannot be made localpublic FileObject getParent()
FileObject
getParent
in class FileObject
public long getSize()
FileObject
getSize
in class FileObject
public boolean isData()
FileObject
isData
in class FileObject
public boolean isFolder()
FileObject
isFolder
in class FileObject
public boolean isReadOnly()
FileObject
isReadOnly
in class FileObject
public boolean isRoot()
FileObject
isRoot
in class FileObject
public boolean isLocal()
FileObject
isLocal
in class FileObject
public boolean exists()
FileObject
exists
in class FileObject
public java.lang.String getNameExt()
FileObject
getNameExt
in class FileObject
public java.util.Date lastModified()
FileObject
lastModified
in class FileObject