|
IP*Works! ZIP V8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworkszip.TARFile
The Tar file in the archive.
This type contains information about the Tar 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.
HardLinkName:
The hard link name, for a file that represents a hard link.
If you specify HardLinkName
the file will be added to the tar file as a
hard link. You should specify the name of the link in CompressedName
and the name of the linked file in HardLinkName
.
Permissions: This field contains the UNIX permissions of the file, as stored in the tar archive. It will be written to the tar archive during compression. As native code is not used, permissions are read from and written to the tar archive only, and not to the file system.
The value should be specified as a string of three characters, representing the owner's permissions, the group's permissions, and others' permissions. Each character should be a bitmask of 4 (read access), 2 (write access), or 1 (executable access), as in chmod .
In Java , if the SetFilePermissions configuration setting is set to true ,
the bean will shell out an instance of chmod for each file, and will attempt to
set the file permissions to those specified in Permissions
. Obviously, this
functionality is operating system dependent and will fail in Windows in particular; it may also
fail in other operating systems for a variety of reasons.
SymLinkName:
The symbolic link name, for a file that represents a symbolic link.
If you specify SymLinkName
the file will be added to the tar file as a
symbolic link. You should specify the name of the link in CompressedName
and the name of the linked file in SymLinkName
.
Gzip
,
Gzip.TARFile
Constructor Summary | |
TARFile()
|
|
TARFile(java.lang.String decompressedName)
|
|
TARFile(java.lang.String compressedName,
java.io.InputStream inputStream)
|
|
TARFile(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.lang.String |
getHardLinkName()
|
java.lang.String |
getPermissions()
|
java.lang.String |
getSymLinkName()
|
void |
setCompressedDate(long value)
|
void |
setCompressedName(java.lang.String value)
|
void |
setDecompressedName(java.lang.String value)
|
void |
setHardLinkName(java.lang.String value)
|
void |
setPermissions(java.lang.String value)
|
void |
setSymLinkName(java.lang.String value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TARFile()
public TARFile(java.lang.String decompressedName)
public TARFile(java.lang.String compressedName, java.lang.String decompressedName)
public TARFile(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.lang.String getHardLinkName()
public void setHardLinkName(java.lang.String value)
public java.lang.String getPermissions()
public void setPermissions(java.lang.String value)
public java.lang.String getSymLinkName()
public void setSymLinkName(java.lang.String value)
|
IP*Works! ZIP V8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |