TOOLS: Compression
The objective of this document is to explain in short how to use the tool included in package compressionTools_v0.3 that can be used to compress or decompress a container according to the CWA2 specification “Metadata container”.
Note these tools are part of a proof of concept, and still are in alpha state. These tools are provided “AS IS”, without warranty of any kind.
Download the tool: compressionTools_v0.3. Download the CWA2 test material: CWA2TestData_v0.3.
Prerequisites:
Before using this tool, you need:
- Java: If Java SE (Standard Edition) is not installed on your computer, download from oracle and install it. This package has been tested with java version 1.6.0, so this version or a newer one should be fine. If Java SE is installed on your computer, verify version (by using “java –version”), and if needed download and install a newer one;
- Package compressionTools_v0.3.jar;
Creation of a compressed container: compressionTools.ZipFile
To compress a container, use the command:
java.exe –classpath compressionTools_v0.3.jar compressionTools.LaunchZipFile -c containerdirectory -o outputdirectory
Where:
- -c containerdirectory: file path in which the content of the pure container structure is collected
- -o outputdirectory: Output directory in which the compressed container will be generated
Sample command
The following command includes everything from the directory C:\CWA2TestData_v0.3\zip\in\dir1 and compresses them by using a Zip compression algorithm. The resulting zip file will be saved as C:\CWA2TestData_v0.3\zip\out\dir1.zip.
“C:\Program Files\Java\jdk1.7.0_04\bin\java.exe” -server -classpath compressionTools_v0.3.jar compressionTools.LaunchZipFile -o C:\CWA2TestData_v0.3\zip\out\dir1.zip -c C:\CWA2TestData_v0.3\zip\in\dir1
Sample output
oct 29, 2013 2:49:55 PM. compressionTools.LaunchZipFile launch
INFO: Container compression completed, result file created at C:\CWA2TestData_v0.3\zip\out\dir1.zip
Decompression of a container: compressionTools.UnZipFile
To compress a container, use the command:
java.exe –classpath compressionTools_v0.3.jar compressionTools.LaunchUnZipFile -f filetodecompress -o outputdirectory
Where:
- -f filetodecompress: file path in which the file to be decompressed resides
- -o outputdirectory: Output directory in which the extracted files will be stored
Sample command
The following command reads the file C:\CWA2TestData_v0.3\unZip\in\zip1.zipm, performs a decompression by using an unzip decompression algorithm. The resulting file(s) will be saved into the directory C:\CWA2TestData_v0.3\unZip\out
“C:\Program Files\Java\jdk1.7.0_04\bin\java.exe” -server -classpath compressionTools_v0.3.jar compressionTools.LaunchUnZipFile -f C:\CWA2TestData_v0.3\unZip\in\zip1.zip -o C:\CWA2TestData_v0.3\unZip\out
Sample output
oct 29, 2013 2:54:23 PM. compressionTools.LaunchUnZipFile launch
INFO: 8 files extracted.
oct 29, 2013 2:54:23 PM. compressionTools.LaunchUnZipFile main
INFO: Container extraction completed, result file created at C:\CWA2TestData_v0.3\unZip\out