org.eclipse.emf.ecore.resource.impl
Class ArchiveURIHandlerImpl.Archive

java.lang.Object
  extended by java.net.URLConnection
      extended by org.eclipse.emf.common.archive.ArchiveURLConnection
          extended by org.eclipse.emf.ecore.resource.impl.ArchiveURIHandlerImpl.Archive
Enclosing class:
ArchiveURIHandlerImpl

protected class ArchiveURIHandlerImpl.Archive
extends ArchiveURLConnection

A specialized class for reading from an archive.


Field Summary
protected  java.util.Map<?,?> options
           
protected  java.util.zip.ZipEntry zipEntry
           
 
Fields inherited from class org.eclipse.emf.common.archive.ArchiveURLConnection
urlString
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
ArchiveURIHandlerImpl.Archive(URI uri, java.util.Map<?,?> options)
           
 
Method Summary
protected  java.io.InputStream createInputStream(java.lang.String nestedURL)
          Creates an input stream for the nested URL by calling opening a stream on it.
protected  java.io.OutputStream createOutputStream(java.lang.String nestedURL)
          Creates an output stream for the nested URL by calling opening a stream on it.
protected  boolean emulateArchiveScheme()
           Returns whether the implementation will handle all the archive accessors directly.
 java.util.Map<java.lang.String,?> getAttributes()
           
 void setAttributes(java.util.Map<java.lang.String,?> attributes)
           
protected  boolean useZipFile()
          Returns whether to handle the special case of a nested URL with file: schema using a ZipFile.
protected  java.io.InputStream yield(java.util.zip.ZipEntry zipEntry, java.io.InputStream inputStream)
           
protected  java.io.OutputStream yield(java.util.zip.ZipEntry zipEntry, java.io.OutputStream outputStream)
           
 
Methods inherited from class org.eclipse.emf.common.archive.ArchiveURLConnection
connect, delete, getInputStream, getNestedURL, getOutputStream, setTimeStamp
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

options

protected java.util.Map<?,?> options

zipEntry

protected java.util.zip.ZipEntry zipEntry
Constructor Detail

ArchiveURIHandlerImpl.Archive

public ArchiveURIHandlerImpl.Archive(URI uri,
                                     java.util.Map<?,?> options)
Method Detail

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 java.io.InputStream createInputStream(java.lang.String nestedURL)
                                         throws java.io.IOException
Description copied from class: ArchiveURLConnection
Creates an input stream for the nested URL by calling 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:
java.io.IOException

createOutputStream

protected java.io.OutputStream createOutputStream(java.lang.String nestedURL)
                                           throws java.io.IOException
Description copied from class: ArchiveURLConnection
Creates an output stream for the nested URL by calling 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:
java.io.IOException

yield

protected java.io.InputStream yield(java.util.zip.ZipEntry zipEntry,
                                    java.io.InputStream inputStream)
                             throws java.io.IOException
Overrides:
yield in class ArchiveURLConnection
Throws:
java.io.IOException

yield

protected java.io.OutputStream yield(java.util.zip.ZipEntry zipEntry,
                                     java.io.OutputStream outputStream)
                              throws java.io.IOException
Overrides:
yield in class ArchiveURLConnection
Throws:
java.io.IOException

getAttributes

public java.util.Map<java.lang.String,?> getAttributes()

setAttributes

public void setAttributes(java.util.Map<java.lang.String,?> attributes)
                   throws java.io.IOException
Throws:
java.io.IOException

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.