6.4. Unzip repository adapter

The unzip adapter will locate an artifact by one of several built in rules, including the parameters provided in the URL and then extract the requested file from inside the ZIP file, which is the artifact.

[Note]ZIP File

This adapter only works on ZIP files. Some locator rules automatically filter out anything which is not a ZIP file.

The base entry point to the unzip adapter is http://localhost:8080/unzip. The next element in the path must always be the locator type. Everything after the locator type is specific to the locator implementation. However the scheme should always follow the basic pattern of http://localhost:8080/unzip/<locator>/param1/param2/path/to/file. So after the type comes the parameters specific to the type, following the be deep link inside the ZIP file. This allows to easily build related URLs to the original path and allows for relative linking between elements inside the ZIP file. This is required for directly accessing a zipped P2 repository.

[Note]URL samples

The following URL samples will skip the base prefix http://localhost:8080/unzip. Parameters inside the URL will written in agle brackets (e.g. <param1> ... <param2>). Unless otherwise noted the suffix /path/to/file always refers to the actual deep link inside the ZIP file.

Also see https://github.com/ctron/package-drone/wiki/Unzip-Adapter in the GitHub wiki.

This locator will only retrieve the specified artifact using the artifact ID.

The full URL scheme is /artifact/<artifactId>/path/to/file

The newest locator will simply look for the newest artifact in a channel.

The full URL scheme is /newest/<channelIdOrName>/path/to/file

The newest ZIP locator will simply look for the newest artifact in a channel which is a ZIP file.

The full URL scheme is /newestZip/<channelIdOrName>/path/to/file

This locator will search a channel for the newest artifact matching the provided name.

The full URL scheme is /newestByName/<channelIdOrName>/<name>/path/to/file

This locator uses maven specific metadata and has a few sub types of operation.

The base URL scheme is /maven/<subType>/<channelIdOrName>

[Note]Maven meta data

This locator requires maven metadata, which will only be present at the moment if the artifacts where deploy using the maven repository adapter and mvn deploy.

This sub type will scan for a maven artifact with matching group id, artifact id and version prefix. If there are several matching versions in the same channel, then the highest ranking according to maven will be used.

The full URL scheme is /maven/prefixed/<channelIdOrName>/<groupId>/<artifactId>/<versionPrefix>/path/to/file

The version prefix is a string like 1.2.x, 1.x or 1.x-SNAPSHOT. If the version prefix ends with -SNAPSHOT then only snapshot versions will be considered.

The version prefix string is scanned for the first occurrence of x, which marks the end of the prefix. In order for an artifact to match, the start of artifact version must match the specified prefix. See the following examples:

Prefix in URLPrefix for matchSnapshots?
1.0.x1.0.no
1.2.x1.2.no
1.x1.no
1.x.x1.no
1.x.41.no
1.2.x-SNAPSHOT1.2.yes
1.x-SNAPSHOT1.yes
1.2x1.2yes

Assuming the channel has the alias name m1 and contains the following artifacts, deployed using the Maven 2 adapter.

Group IDArtifact IDVersionSnapshot Version
testart11.0.0-SNAPSHOT20150102.101010-1
testart11.0.0 
testart11.1.0-SNAPSHOT20150102.101010-1
testart11.1.0-RC1 
testart11.1.0 
testart12.0.0-SNAPSHOT20150102.101010-1
testart12.0.0-SNAPSHOT20150103.101010-1
testart12.0.0-SNAPSHOT20150104.101010-1
testart12.0.0-RC1 
testart12.0.0-RC2 
testart12.0.0 
testart12.0.1-SNAPSHOT20150102.101010-1
testart12.0.1 
testart12.1.0-SNAPSHOT20150102.101010-1
testart12.1.0-SNAPSHOT20150103.101010-1
testart12.1.0-SNAPSHOT20150104.101010-1
testart12.1.0-RC1 
testart12.1.0-RC2 
testart12.1.0 
testart13.0.0-SNAPSHOT20150102.101010-1
testart13.1.0-SNAPSHOT20150102.101010-1

The following table shows a few examples

TaskURLResult
Latest release/latest/m1/test/art1/path/to/filetest/art1-2.1.0
Latest snapshot/latest-SNAPSHOT/m1/test/art1/path/to/filetest/art1-3.0.0-20150102.101010-1
Latest 2.0 release/prefixed/m1/test/art1/2.0.x/path/to/filetest/art1-2.0.1
Latest 2.x release/prefixed/m1/test/art1/2.x/path/to/filetest/art1-2.1.0
Latest 3.x snapshot/prefixed/m1/test/art1/3.x-SNAPSHOT/path/to/filetest/art1-3.1.0-20150102.101010-1
Specific version 1.1.0-RC1/perfect/m1/test/art1/1.1.0-RC1/path/to/filetest/art1-1.1.0-RC1
Specific version 2.0.0-SNAPSHOT/perfect/m1/test/art1/2.0.0-SNAPSHOT/path/to/filetest/art1-2.0.0-20150104.101010-1

Since there are several versions matching 2.0.0-SNAPSHOT, the highest ranking snapshot release will be used, which is identified by the specific snapshot version.

Specific snapshot version 2.0.0-20150102.101010-1/perfect/m1/test/art1/2.0.0-20150102.101010-1/path/to/filetest/art1-2.0.0-20150102.101010-1
Specific snapshot version 2.0.0-20140101.101010-1/perfect/m1/test/art1/2.0.0-20140101.101010-1/path/to/file404 error since the requested artifact is no in the channel