Search: 
Available in: ZIP
Jar Component [IP*Works! ZIP V7]

Properties   Methods   Events   Configuration Settings  

The Jar component may be used to create or decompress Java archives.

NOTE: What follows is a very short description of the component interfaces. For more information, please consult the help files that come with the respective package.

Remarks

The operation of the component is similar to that of Zip. .class and other files may be added into a .jar file, and then may be imported into Java code or executed by a JVM.

To create a new archive, first set the ArchiveFile property to the name of the archive to be created. Then, specify the files to be compressed either by invoking IncludeFiles, or by setting the values of FileCount, FileDecompressedName, and FileCompressedName. Finally, call the Compress method to create the archive.

To decompress an existing archive, set ArchiveFile to the name of the archive to be decompressed. The ExtractToPath property may be set, and then calling the ExtractAll method will decompress all files in the archive to this path.

For finer control, the Scan method should be used to read the file information stored in the archive. This will fill out the information in FileCount, FileCompressedName, FileDecompressedName, FileCompressedSize, and FileDecompressedSize. The values of FileDecompressedName may then be changed if desired. Finally, ExtractAll may be used to decompress the entire archive, or Extract may be used for finer control.

Data may be streamed out by setting EnableStreaming to true. Then, the Progress event may be trapped to retrieve the data.

All Java archives contain two special entries, a META-INF directory and a manifest. By default, the component will automatically generate a default manifest and add the special entries to the beginning of the archive. To instead add a custom manifest to the archive the ManifestFile property should be set.

During decompression, the archive is treated as an ordinary zip file.

Example (Creating a Jar File)

   
ZipControl.ArchiveFile = "c:\test.jar"
ZipControl.RecurseSubdirectories = false
ZipControl.IncludeFiles("c:\code\*.class")
ZipControl.ManifestFile = "c:\code\manifest.mf"
ZipControl.Compress()
Example (Extracting from a Jar File)

   
ZipControl.ArchiveFile = "c:\test.jar"
ZipControl.ExtractToPath = "c:\unzipped\"
ZipControl.Extract("*.class")

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for complete descriptions.

ArchiveFile The name of the zip, gzip, tar, or jar archive.
CompressionLevel The compression level to use.
EnableStreaming Whether or not to enable streaming.
ExcludedFiles A list of files to exclude.
ExtractToPath A base path to decompress to.
FileCompressedDate The date and time of the entry, as stored within the archive.
FileCompressedName Array of filenames, as stored inside of the archive.
FileCompressedSize The compressed size of the entry.
FileCount The number of entries in the archive.
FileDecompressedName Array of filenames, as stored outside of the archive.
FileDecompressedSize The decompressed size of the file.
ManifestFile The name of the manifest file.
OverwriteFiles Whether or not to overwrite files.
RecurseSubdirectories Whether or not to recurse into subdirectories.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for complete descriptions.

Abort Aborts the current operation.
Append Adds a file to an existing archive.
Compress Creates the compressed archive.
Config Sets or retrieves a component configuration setting.
Delete Deletes one or more files from an existing archive.
Extract Extracts a single file, directory, or group of files, from the archive.
ExtractAll Extracts all files from the compressed archive.
IncludeFiles Specifies that the indicated files should be added to the archive.
Reset Resets the component.
Scan Scans the compressed archive.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for complete descriptions.

BeginFile Fired before each file is processed.
EndFile Fired after each file is processed.
Error Information about non-fatal errors.
Overwrite Fired whenever a file exists and may be overwritten.
Progress Fired as progress is made.

Configuration Settings


The following is a list of configuration settings for the component with short descriptions. Click on the links for complete descriptions.

Encoding Encoding to be used for filenames
ExcludedAttributes Attributes to be excluded
OverwriteReadonlyFiles Whether to overwrite readonly files

| About | Privacy Policy | Terms of Use |
© Copyright 2008 /n software inc.