More About Archive Expansion Behavior During Codebase Uploads
The following topics describe important information about how archives are expanded when a codebase is uploaded
• | Handling of the Archives After Their Expansion |
• | Expansion of Archives Containing an Intermediary .tar File |
• | Archive Handling When Multiple Codebases Are Uploaded to the Same Project |
Handling of the Archives After Their Expansion
When an archive is expanded, its contents are extracted to a folder automatically created (with the archive’s name) directly under the archive’s parent folder. What happens to the archive once it is expanded depends on how the Delete Archive Files After Expansion is configured.
For example, suppose the archive AppsSport.zip is located in the coreApps directory in your codebase. The AppsSport.zip archive contains the files hockey1.exe and tennis.exe.
Archive Retention Configured
If Delete Archive Files After Expansion is not selected, the archive AppsSport.zip is retained in its parent folder, coreApps, once it is expanded. The resulting codebase tree looks like this, where both AppsSport.zip and a folder AppsSport, containing the archive contents, are found directly under coreApps:
coreApps
---AppsSport
-----hockey1.exe
-----tennis1.exe
---AppsSport.zip
Note that, when an archive is retained, both the archive and its extracted files are processed during a codebase scan.
Archive Removal Configured
If Delete Archive Files After Expansion is selected, the archive AppsSport.zip is removed once it is expanded, resulting in the following codebase tree:
coreApps
---AppsSport
-----hockey1.exe
-----tennis1.exe
Expansion of Archives Containing an Intermediary .tar File
The .tar.gz, .tgz, .txz, and .tar.xz archive types and similar archives contain an intermediary .tar archive. The codebase upload extracts the intermediary .tar file from the archive, but applies the Archive Expansion Options configuration starting with the expansion of the intermediary .tar file, not the initial archive. The following example demonstrates this expansion behavior.
Suppose the archive jars.tar.gz has these contents, where the intermediary file is jar.tar:
jars.tar.gz
--jars.tar
----file-1.txt
----file-2.txt
----jar.zip
------abc.jar (color)
------xyz.jar
------classes.zip
--------corporation.class
--------employee.class
The uploaded codebase looks like this if Uploaded File Only for Archive Expansion Options is applied. The jars.tar is extracted from jars.tar.gz. The jars.tar archive is then expanded, but the jar.zip file (contained in jars.tar) is not expanded. Keep in mind that the original archive files are retained.
file-1.txt
file-2.txt
jar.zip
The uploaded codebase looks like this if the Uploaded file and first-level archives only option for Archive Expansion Options is used. The jars.tar is extracted from the initial jars.tar.gz. Once the jars.tar archive is expanded, the first-level jar.zip file (contained in jars.tar) is also expanded. However, the second-level classes.zip (contained in jar.zip) is not expanded.
file-1.txt
file-2.txt
\jar
---abc.jar
---xyz.jar
---classes.zip
jar.zip
The uploaded codebase looks like this if the Uploaded file and all contained archives option for Archive Expansion Options is used. The jars.tar is extracted from the initial jars.tar.gz. Once jars.tar archive is expanded, the first-level jar.zip file and the second-level classes.zip file are also expanded.
jars.tar
file-1.txt
file-2.txt
\jar
---abc.jar
---xyz.jar
---\classes
------Corporation.class
------Employee.class
---classes.zip
jar.zip
Archive Handling When Multiple Codebases Are Uploaded to the Same Project
If multiple codebases are uploaded to the same codebase path for a given project (and existing codebase files are not deleted), the archives within all the codebases for the project are expanded based on the current Archive Expansion Options configuration. The following process demonstrates this behavior:
1. | Create project1 and upload the codebase codefiles1.zip, using the Uploaded file only option. The contents of codefile1.zip are extracted. Archives in these contents are not expanded. |
2. | Upload codefile2.zip to the same project (at the same codebase path), this time using the Uploaded file and all contained archives. (Keep in mind that codebase1.zip was previously expanded with no further expansion of any archives in its contents.) Now all archives at all levels are expanded within the codefile1 and codefile2 codebases. |
3. | Upload codefile3.zip to the same project, this time using Uploaded file and first-level archives only. Now only the first-level archives in all three codebases are expanded. |
If you upload multiple codebases to the same project, best practice is to keep track of the Archive Expansion Options configuration for each upload so that you can apply an appropriate configuration for the subsequent upload.