archive:$nestedURL${/!$archivePath$}+So the nested URL for the example above is
file:///c:/temp/example.zip
Since the nested URL may itself contain archive schemes, the subsequence of the archive paths that should be associated with the nested URL is determined by finding the nth archive separator, i.e., the nth !/, where n is the number of ":"s before the first "/" of the nested URL, i.e., the number of nested schemes. For example, for a more complex case where the nested URL is itself an archive-based scheme, e.g.,
archive:jar:file:///c:/temp/example.zip!/org/example/nested.zip!/org/example/deeply-nested.htmlthe nested URL is correctly parsed to skip to the second archive separator as
jar:file:///c:/temp/example.zip!/org/example/nested.zip
The logic for accessing archives can be tailored and reused independant from its usage as a URL connection. This is normally done by using the constructor {@link #ArchiveURLConnection(String)}and overriding {@link #createInputStream(String)} and {@link #createOutputStream(String)}. The behavior can be tailored by overriding {@link #emulateArchiveScheme()} and {@link #useZipFile()}.
|
|