public class JarZipSchemeScanner extends java.lang.Object implements UriSchemeScanner
ScannerListener
.Constructor and Description |
---|
JarZipSchemeScanner() |
Modifier and Type | Method and Description |
---|---|
protected Closing |
closing(java.lang.String jarUrlString)
Obtain a
Closing of the jar file. |
java.util.Set<java.lang.String> |
getSchemes()
Get the set of supported URI schemes.
|
void |
scan(java.net.URI u,
ScannerListener cfl)
Perform a scan and report resources to a scanning listener.
|
public java.util.Set<java.lang.String> getSchemes()
UriSchemeScanner
getSchemes
in interface UriSchemeScanner
public void scan(java.net.URI u, ScannerListener cfl)
UriSchemeScanner
scan
in interface UriSchemeScanner
u
- the URI to scan for resources.cfl
- the scanning listener to report entries.protected Closing closing(java.lang.String jarUrlString) throws java.io.IOException
Closing
of the jar file.
For most platforms the format for the zip or jar follows the form of the
jar:file:///tmp/fishfingers.zip!/example.txt
zip:http://www.example.com/fishfingers.zip!/example.txt
On versions of the WebLogic application server a proprietary format is supported of the following form, which assumes a zip file located on the local file system:
zip:/tmp/fishfingers.zip!/example.txt
zip:d:/tempfishfingers.zip!/example.txt
This method will first attempt to create a Closing
as follows:
new Closing(new URL(jarUrlString).openStream());if that fails with a
MalformedURLException
then the method will
attempt to create a Closing
instance as follows:
return new Closing(new FileInputStream( UriComponent.decode(jarUrlString, UriComponent.Type.PATH)));
jarUrlString
- the raw scheme specific part of a URI minus the jar
entryClosing
.java.io.IOException
- if there is an error opening the stream.Copyright © 2016 Oracle Corporation. All Rights Reserved.