After a PBCS snapshot is extracted, modified, and re-archived, it is no longer accepted as a valid Snapshot by PBCS. Even when performing no modifications to the source files, PBCS will not accept an archive that has seemingly been modified.
When uploading these snapshots, PBCS will refuse to display the size of the uploaded snapshot, and the option to deploy the snapshot is unavailable.
A valid PBCS snapshot archive appears as below:
The Unix command being executed, zipinfo, describes the zip file. The output of this command lists the number of items included within the archive.
After extracting and re-archiving the folder with the default compression method, the output archive appears as below:
This snapshot is no longer valid for two reasons:
- The leading folder/directory is now present in the archive. In this example, the item definitions all specify TASK_1 as the root folder. This folder is absent in the valid snapshot.
- The number of entries is now different than the original archive due to folder/directory definitions being included in the archived file. Folder items are absent in valid snapshots. Note this is still a valid ZIP file, albeit one that contains additional information
Therefore, to generate a valid Snapshot, any archive must:
- Include only file definitions, and no folder definitions.
- The root folder should not be included in the archive.
The restrictions defined in the Solution above may be problematic or difficult to perform manually, so I’ve developed a Java program which can perform the extract and archive functions properly — you can download it below.
To setup the program:
- Download the applicable JAR file. This can be understood as the executable which will perform the task. Place this in an easily accessible location (Documents, Desktop, etc).
- Install Java 1.7 or greater.
To extract a snapshot:
- Open Powershell or CMD.
- Execute the following command: java -jar \path\to \pbcsArchive.jar extract \path\to\snapshot.zip
To archive a snapshot:
- Open Powershell or CMD.
- Execute the following command: java -jar \path\to\pbcsArchive.jar archive \path\to\folder\
- The resulting archive will use the folder name and append “-modified” to the end (e.g. exampleFolder will become exampleFolder-modified.zip).
If you wish to use this script/program, please be sure to use it to both extract AND archive a snapshot. This will ensure the snapshot will be properly processed.
This script has not been tested extensively. If any issues are encountered, please contact us so we can prepare resolutions.