org.eclipse.rse.services.clientserver.archiveutils
Class VirtualChild
java.lang.Object
org.eclipse.rse.services.clientserver.archiveutils.VirtualChild
-
public final class VirtualChild
- extends
Object
A simple structure for passing information about virtual files and folders.
Constructor Summary
|
VirtualChild
(
ISystemArchiveHandler handler)
Constructs a new VirtualChild given a reference to its parent archive's
handler, but does not populate any fields in the child. |
VirtualChild
(
ISystemArchiveHandler handler,
String fullVirtualName)
Constructs a new VirtualChild given a reference to its parent archive's
handler (handler ), and immediately populates the name and path info
for the VirtualChild given its fullVirtualName . |
VirtualChild
(
String fullVirtualName,
File containingArchive)
Constructs a new VirtualChild given the name of its parent archive,
and immediately populates the name and path info
for the VirtualChild given its fullVirtualName . |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
fullName
public
String fullName
name
public
String name
path
public
String path
isDirectory
public boolean isDirectory
_handler
protected
ISystemArchiveHandler _handler
_extractedFile
protected
File _extractedFile
_containingArchive
protected
File _containingArchive
VirtualChild
public VirtualChild(
ISystemArchiveHandler handler)
- Constructs a new VirtualChild given a reference to its parent archive's
handler, but does not populate any fields in the child. Clients must
populate the fullName, name, path, and isDirectory fields.
VirtualChild
public VirtualChild(
ISystemArchiveHandler handler,
String fullVirtualName)
- Constructs a new VirtualChild given a reference to its parent archive's
handler (
handler
), and immediately populates the name and path info
for the VirtualChild given its fullVirtualName
. Clients
must still populate the isDirectory field.
VirtualChild
public VirtualChild(
String fullVirtualName,
File containingArchive)
- Constructs a new VirtualChild given the name of its parent archive,
and immediately populates the name and path info
for the VirtualChild given its
fullVirtualName
. Clients
must still populate the isDirectory field.
NOTE: This constructor is intended only to be used for creating NON-EXISTENT
virtual children.
getHandler
public
ISystemArchiveHandler getHandler()
-
-
Returns:
- This VirtualChild's parent archive's Handler.
getTimeStamp
public long getTimeStamp()
-
-
Returns:
- This VirtualChild's time stamp (retrieves the latest one
from the archive).
setTimeStamp
public void setTimeStamp(long value)
-
-
Parameters:
-
value
- the time stamp value -
Since:
- 3.0
getSize
public long getSize()
-
-
Returns:
- This VirtualChild's uncompressed size (retrieves the latest one
from the archive).
setSize
public void setSize(long value)
-
-
Parameters:
-
value
- the size value -
Since:
- 3.0
getComment
public
String getComment()
-
-
Returns:
- The comment associated with this VirtualChild.
setComment
public void setComment(
String value)
-
-
Parameters:
-
value
- the comment value -
Since:
- 3.0
getCompressedSize
public long getCompressedSize()
-
-
Returns:
- The amount of space this VirtualChild takes up in the archive
in compressed form.
setCompressedSize
public void setCompressedSize(long value)
-
-
Parameters:
-
value
- the compressedSize value -
Since:
- 3.0
getCompressionMethod
public
String getCompressionMethod()
-
-
Returns:
- The method used to compress this VirtualChild.
setCompressionMethod
public void setCompressionMethod(
String value)
-
-
Parameters:
-
value
- the compression method value -
Since:
- 3.0
getCompressionRatio
public double getCompressionRatio()
-
-
Returns:
- The actual minus compressed size of this VirtualChild, divided
by the actual size.
getExtractedFile
public
File getExtractedFile()
throws
SystemMessageException
-
-
Returns:
- The extracted file or directory represented by this VirtualChild from the archive.
Note that the extracted file is cached after it is extracted once, but if the
timestamps on the cached and archived files do not match, the cached file is erased,
and reextracted from the archive.
-
Throws:
-
SystemMessageException
getExtractedFile
public
File getExtractedFile(
String sourceEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
throws
SystemMessageException
-
-
Returns:
- The extracted file or directory represented by this VirtualChild
from the archive. Assumes that the file has been encoded in the
encoding specified. Note that the extracted file is cached after
it is extracted once, but if the timestamps on the cached and
archived files do not match, the cached file is erased, and
re-extracted from the archive.
-
Throws:
-
SystemMessageException
-
Since:
- 3.0 throws SystemMessageException
getExtractedFile
public void getExtractedFile(
File destination,
ISystemOperationMonitor archiveOperationMonitor)
throws
SystemMessageException
- Gets the extracted file or directory represented by this VirtualChild
from the archive, and replaces the object referred to by
destination
with that extracted file or directory. Note that
the extracted file is cached after it is extracted once, but if the
timestamps on the cached and archived files do not match, the cached file
is erased, and re-extracted from the archive. destination
is
always overwritten with either what is cached, or what is in the archive.
-
-
Throws:
-
SystemMessageException
- in case of an error -
Since:
- 3.0 throws SystemMessageException
getExtractedFile
public void getExtractedFile(
File destination,
String sourceEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
throws
SystemMessageException
- Gets the extracted file or directory represented by this VirtualChild
from the archive, and replaces the object referred to by
destination
with that extracted file or directory. Note that
the extracted file is cached after it is extracted once, but if the
timestamps on the cached and archived files do not match, the cached file
is erased, and reextracted from the archive. destination
is
always overwritten with either what is cached, or what is in the archive.
-
-
Throws:
-
SystemMessageException
- in case of an error -
Since:
- 3.0 throws SystemMessageException
exists
public boolean exists()
throws
SystemMessageException
-
-
Returns:
- Whether or not this VirtualChild exists in the archive.
-
Throws:
-
SystemMessageException
renameTo
public void renameTo(
String newName)
- Renames this virtual child to newName. WARNING!!
This method does not change the underlying zip file,
you must rename the entry in the zip file for subsequent
calls to any of the getters to work.
-
getArchiveStandardName
public
String getArchiveStandardName()
-
-
Returns:
- The "standard" name for this VirtualChild, based on
the handler type.
getContainingArchive
public
File getContainingArchive()
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.