org.eclipse.emf.ecore.resource.impl
Class URIConverterImpl.Archive
java.lang.Object
java.net.URLConnection
org.eclipse.emf.common.archive.ArchiveURLConnection
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.Archive
- Enclosing class:
- URIConverterImpl
- protected class URIConverterImpl.Archive
- extends ArchiveURLConnection
A specialized class for reading from an archive.
Method Summary |
protected InputStream |
createInputStream(String nestedURL)
Creates an input stream for the nested URL by calling URL#openStream()opening a stream on it. |
protected OutputStream |
createOutputStream(String nestedURL)
Creates an input stream for the nested URL by calling URL#openStream()opening a stream on it. |
protected boolean |
emulateArchiveScheme()
Returns whether the implementation will handle all the archive accessors directly.
|
protected boolean |
useZipFile()
Returns whether to handle the special case of a nested URL with file: schema using a ZipFile .
|
Methods inherited from class java.net.URLConnection |
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString |
URIConverterImpl.Archive
public URIConverterImpl.Archive(URI uri)
emulateArchiveScheme
protected boolean emulateArchiveScheme()
- Description copied from class:
ArchiveURLConnection
-
Returns whether the implementation will handle all the archive accessors directly.
For example, whether
archive:jar:file:///c:/temp/example.zip!/org/example/nested.zip!/org/example/deeply-nested.html
will be handled as if it were specified as
archive:file:///c:/temp/example.zip!/org/example/nested.zip!/org/example/deeply-nested.html
Override this only if you are reusing the logic of retrieving an input stream into an archive
and hence are likely to be overriding createInputStream,
which is the point of delegation to the nested URL for recursive stream creation.
- Overrides:
emulateArchiveScheme
in class ArchiveURLConnection
- Returns:
- whether the implementation will handle all the archive accessors directly.
useZipFile
protected boolean useZipFile()
- Description copied from class:
ArchiveURLConnection
- Returns whether to handle the special case of a nested URL with file: schema using a
ZipFile
.
This gives more efficient direct access to the root entry, e.g.,
archive:file:///c:/temp/example.zip!/org/example/nested.html
- Overrides:
useZipFile
in class ArchiveURLConnection
- Returns:
- whether to handle the special case of a nested URL with file: schema using a ZipFile.
createInputStream
protected InputStream createInputStream(String nestedURL)
throws IOException
- Description copied from class:
ArchiveURLConnection
- Creates an input stream for the nested URL by calling
URL#openStream()opening
a stream on it.
- Overrides:
createInputStream
in class ArchiveURLConnection
- Parameters:
nestedURL
- the nested URL for which a stream is required.
- Returns:
- the open stream of the nested URL.
- Throws:
IOException
createOutputStream
protected OutputStream createOutputStream(String nestedURL)
throws IOException
- Description copied from class:
ArchiveURLConnection
- Creates an input stream for the nested URL by calling
URL#openStream()opening
a stream on it.
- Overrides:
createOutputStream
in class ArchiveURLConnection
- Parameters:
nestedURL
- the nested URL for which a stream is required.
- Returns:
- the open stream of the nested URL.
- Throws:
IOException