|
IP*Works! ZIP V8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworkszip.JARFile
The Jar file in the archive.
This type contains information about the Jar file that either exists in the archive or is being added to the archive.
CompressedDate: The date and time of the entry, as stored within the archive.
FileCompressedDate contains the last modified date of the file, as stored within the archive. (It does not generally correspond to when the file was compressed.)
FileCompressedDate is returned in a platform-specific format. The Java Edition will return the number of milliseconds since January 1, 1970, 00:00:00. This value may be passed directly to the java.util.Date constructor to create a java.util.Date object representing this date.
The .NET Edition will return the number of ticks, or 100-nanosecond intervals, since January 1, 0001, 00:00:00. This value may be passed directly to the System.DateTime constructor to create a System.DateTime object representing this date.
Reading the value of this property will return a meaningful value only after the archive has
been successfully scanned or decompressed, and only if the values
of ArchiveFile
, Files
collection, and CompressedName
have not been changed since.
If a meaningful value is not available this property will return a value of 0.
NOTE: This may be set accordingly when the InputStream
field is set to a valid stream to
input the data for the current file. If not set, the default, 0, is used. Otherwise the
value is read from disk.
CompressedName:
The file name of the current file, as stored inside of the archive.
This may be the same as in DecompressedName
, but is not required to be.
All paths are stored in the archive in standard (UNIX) format. Pathnames specified in the host operating system's format will be immediately converted.
This field should generally be set with a relative path or with no path at all. The exact interpretation of the path is left to the decompression software; generally, pathnames will be interpreted as relative to a base directory, and these subdirectories will be created as needed. Absolute pathnames will not be interpreted correctly by the bean, and may or may not be interpreted correctly by other decompression software.
Paths should be specified in standard (UNIX) format. They may also be specified in the format native to the host operating system, in which case they will be immediately converted.
Example
ZipControl.ArchiveFile = "c:\\test.zip"
ZipControl.Files.Add(new ZIPFile())
ZipControl.Files[0].DecompressedName = "c:\\test\\ipworkszip\\temp\\test.txt"
ZipControl.Files[0].CompressedName = "readme.txt"
ZipControl.Compress()
CompressedSize: The size of the compressed data, as compressed within the archive. Headers, footers, etc., are not included in the size.
Reading the value of this property will return a meaningful value only after the
archive has been compressed, scanned, or decompressed, and only if the values
of ArchiveFile
, Files
have not been changed since.
If a meaningful value is not available this property will return a value of -1.
DecompressedName: The name of the file in the archive, as stored on the file system, outside the archive.
When compressing files, this field should be specified with a path, if necessary, to allow the file to be found by the bean. If the file cannot be found during compression, a trappable error will be generated, and the archive will not be correctly written.
When decompressing files, the field indicates where the file should be written. After the
archive is scanned, the values of CompressedName
and DecompressedName will be
set to the exact filenames found in the archive. The value of DecompressedName may then be changed if desired.
If DecompressedName is set to an empty string before extraction, the file
will not be written to disk at all. It will still be written to the Progress event
if WriteToProgressEvent
is set to true.
If DecompressedName is set to an empty string before compression, the file will be skipped, and not written to the archive.
A base path for decompression may be specified by setting the ExtractToPath
property.
If ExtractToPath
is set to a non-empty string, the files will be decompressed to the
directory specified in ExtractToPath
. If the value of DecompressedName
contains
a pathname it will be regarded as relative to ExtractToPath
.
Paths on the local file system should be specified in the format native to the host operating system. They may also be specified in standard (UNIX) format, in which case they will be immediately converted.
Example
ZipControl.ArchiveFile = "c:\\test.tar"
ZipControl.Scan()
ZipControl.ExtractToPath = "c:\\temp\\"
ZipControl.Files[1].DecompressedName = "test\\temp.out"
ZipControl.Extract(ZipControl.Files[1].CompressedName)
Incorrect Example ZipControl.ExtractToPath = "c:\\temp\\"
ZipControl.Files[1].DecompressedName = "c:\\temp\\test\\temp.out"
'The file would be extracted to c:\\temp\\c:\\temp\\test\\temp.out
DecompressedSize:
The size of the file, as decompressed outside the archive. If an archive is open
for read (i.e. has been scanned or decompressed), this information will be read from
the archive headers. If an archive is not open for read, the bean will retrieve
the information for the corresponding value of DecompressedName
from the local
file system.
A value of -1 will be returned in case of an I/O error.
InputStream:
When this field is set to a valid stream, the bean will read in the data
from the stream as the current file instead of reading from the file contained
in the DecompressedName
field.
Gzip
,
Gzip.JARFile
Constructor Summary | |
JARFile()
|
|
JARFile(java.lang.String decompressedName)
|
|
JARFile(java.lang.String compressedName,
java.io.InputStream inputStream)
|
|
JARFile(java.lang.String compressedName,
java.lang.String decompressedName)
|
Method Summary | |
long |
getCompressedDate()
|
java.lang.String |
getCompressedName()
|
long |
getCompressedSize()
|
java.lang.String |
getDecompressedName()
|
long |
getDecompressedSize()
|
java.io.InputStream |
getInputStream()
|
void |
setCompressedDate(long value)
|
void |
setCompressedName(java.lang.String value)
|
void |
setDecompressedName(java.lang.String value)
|
void |
setInputStream(java.io.InputStream value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JARFile()
public JARFile(java.lang.String decompressedName)
public JARFile(java.lang.String compressedName, java.lang.String decompressedName)
public JARFile(java.lang.String compressedName, java.io.InputStream inputStream)
Method Detail |
public long getCompressedDate()
public void setCompressedDate(long value)
public java.lang.String getCompressedName()
public void setCompressedName(java.lang.String value)
public long getCompressedSize()
public java.lang.String getDecompressedName()
public void setDecompressedName(java.lang.String value)
public long getDecompressedSize()
public java.io.InputStream getInputStream()
public void setInputStream(java.io.InputStream value)
|
IP*Works! ZIP V8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |