org.eclipse.emf.ecore.resource.impl
Class URIConverterImpl

java.lang.Object
  extended by org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl
      extended by org.eclipse.emf.ecore.resource.impl.URIConverterImpl
All Implemented Interfaces:
URIConverter

Deprecated. since 2.4; use ExtensibleURIConverterImpl instead.

@Deprecated
public class URIConverterImpl
extends ExtensibleURIConverterImpl

A highly functional and extensible URI converter implementation.

This implementation provides seamless transparent Eclipse integration by supporting the platform:/resource mechanism both inside of Eclipse and outside of Eclipse. Furthermore, although the implementation imports both org.eclipse.core.runtime and org.eclipse.core.resources, and hence requires the Eclipse libraries at development time, the implementation does not require them at runtime. Clients of this implementation must be cautious if they wish to maintain this platform neutral behaviour.


Nested Class Summary
protected  class URIConverterImpl.Archive
          Deprecated. A specialized class for reading from an archive.
static class URIConverterImpl.PlatformResourceOutputStream
          Deprecated. @since 2.4; use PlatformResourceURIHandlerImpl.PlatformResourceOutputStream directly.
static interface URIConverterImpl.URIMap
          Deprecated. since 2.4 use ExtensibleURIConverterImpl.URIMap instead.
static class URIConverterImpl.WorkbenchHelper
          Deprecated. since 2.4; use PlatformResourceURIHandlerImpl.WorkbenchHelper directly.
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl
ExtensibleURIConverterImpl.ContentHandlerList, ExtensibleURIConverterImpl.URIHandlerList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.URIConverter
URIConverter.Cipher, URIConverter.Readable, URIConverter.ReadableInputStream, URIConverter.Writeable, URIConverter.WriteableOutputStream
 
Field Summary
protected static IWorkspaceRoot workspaceRoot
          Deprecated.  
 
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl
contentHandlers, uriHandlers, uriMap
 
Fields inherited from interface org.eclipse.emf.ecore.resource.URIConverter
ATTRIBUTE_ARCHIVE, ATTRIBUTE_DIRECTORY, ATTRIBUTE_EXECUTABLE, ATTRIBUTE_HIDDEN, ATTRIBUTE_LENGTH, ATTRIBUTE_READ_ONLY, ATTRIBUTE_TIME_STAMP, INSTANCE, NULL_TIME_STAMP, OPTION_REQUESTED_ATTRIBUTES, OPTION_RESPONSE, OPTION_URI_CONVERTER, RESPONSE_TIME_STAMP_PROPERTY, URI_MAP
 
Constructor Summary
URIConverterImpl()
          Deprecated. since 2.4; use new ExtensibleURIConverterImpl() instead.
 
Method Summary
protected  URIConverterImpl.Archive createArchive(URI uri)
          Deprecated.  
protected  java.io.InputStream createArchiveInputStream(URI archiveURI)
          Deprecated. Creates an input stream for the archive paths and returns it.
protected  java.io.OutputStream createArchiveOutputStream(URI archiveURI)
          Deprecated. Creates an output stream for the archive access.
protected  java.io.InputStream createEFSInputStream(URI uri)
          Deprecated. Creates an input stream for the URI, assuming it's a URI recognized by the Eclipse File System, and returns it.
protected  java.io.OutputStream createEFSOutputStream(URI uri)
          Deprecated. Creates an output stream for the URI, assuming it's a URI recognized by the Eclipse File System, and returns it.
protected  java.io.InputStream createFileInputStream(java.lang.String filePath)
          Deprecated. Creates an input stream for the file path and returns it.
protected  java.io.OutputStream createFileOutputStream(java.lang.String filePath)
          Deprecated. Creates an output stream for the file path and returns it.
 java.io.InputStream createInputStream(URI uri)
          Deprecated. Creates an input stream for the URI and returns it.
 java.io.InputStream createInputStream(URI uri, java.util.Map<?,?> options)
          Deprecated. Creates an input stream for the URI and returns it.
 java.io.OutputStream createOutputStream(URI uri)
          Deprecated. Creates an output stream for the URI and returns it.
 java.io.OutputStream createOutputStream(URI uri, java.util.Map<?,?> options)
          Deprecated. Creates an output stream for the URI and returns it.
protected  java.io.InputStream createPlatformResourceInputStream(java.lang.String platformResourcePath)
          Deprecated. Creates an input stream for the platform resource path and returns it.
protected  java.io.OutputStream createPlatformResourceOutputStream(java.lang.String platformResourcePath)
          Deprecated. Creates an output stream for the platform resource path and returns it.
protected  java.io.InputStream createURLInputStream(URI uri)
          Deprecated. Creates an input stream for the URI, assuming it's a URL, and returns it.
protected  java.io.OutputStream createURLOutputStream(URI uri)
          Deprecated. Creates an output stream for the URI, assuming it's a URL, and returns it.
protected  URIConverterImpl.URIMap getInternalURIMap()
          Deprecated. since 2.4; there should be no need to call this method directly so use ExtensibleURIConverterImpl.getURIMap() instead.
protected  boolean isArchiveScheme(java.lang.String scheme)
          Deprecated. Returns whether the scheme is one that this implementation should treat as an archive.
protected  boolean isEFSScheme(java.lang.String scheme)
          Deprecated. Returns whether the scheme is one that this implementation should treat as a supported Eclipse File System scheme.
 
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl
contentDescription, delete, exists, getAttributes, getContentHandlers, getURIHandler, getURIHandlers, getURIMap, normalize, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workspaceRoot

@Deprecated
protected static IWorkspaceRoot workspaceRoot
Deprecated. 
The cached Eclipse workspace.

Constructor Detail

URIConverterImpl

@Deprecated
public URIConverterImpl()
Deprecated. since 2.4; use new ExtensibleURIConverterImpl() instead.

Creates an instance.

Method Detail

isArchiveScheme

protected boolean isArchiveScheme(java.lang.String scheme)
Deprecated. 
Returns whether the scheme is one that this implementation should treat as an archive. This implementation returns true when the scheme is "archive".

Parameters:
scheme - the scheme to consider.
Returns:
whether the scheme is one that this implementation treats as an archive.

isEFSScheme

protected boolean isEFSScheme(java.lang.String scheme)
Deprecated. 
Returns whether the scheme is one that this implementation should treat as a supported Eclipse File System scheme. This implementation uses Java reflection to check whether there is an Eclipse File System available and if so whether it supports this scheme.

Parameters:
scheme - the scheme to consider.
Returns:
whether the scheme is one that this implementation treats as an Eclipse File System scheme.

createOutputStream

public java.io.OutputStream createOutputStream(URI uri)
                                        throws java.io.IOException
Deprecated. 
Creates an output stream for the URI and returns it.

This implementation normalizes the URI and uses that as the basis for further processing. A file-based URI is converted to a file path, e.g.,

  file:///C:/directory/file
    ->
   C:/directory/file
and is delegated to createFileOutputStream. An archive-based URI is delegated to createArchiveOutputStream. A platform-based URI is converted to a platform path by trimming the leading platform:/resource, e.g.,
  platform:/resource/project/directory/file 
    ->
  /project/directory/file 
and is delegated to createPlatformResourceOutputStream. An EFS-based URI is delegated to createEFSOutputStream. And all other cases are handled as standard URLs by createURLOutputStream.

Specified by:
createOutputStream in interface URIConverter
Overrides:
createOutputStream in class ExtensibleURIConverterImpl
Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.
See Also:
URIConverter.createOutputStream(URI, Map)

createOutputStream

public java.io.OutputStream createOutputStream(URI uri,
                                               java.util.Map<?,?> options)
                                        throws java.io.IOException
Deprecated. 
Description copied from interface: URIConverter
Creates an output stream for the URI and returns it.

It normalizes the URI and uses that as the basis for further processing. Special requirements, such as an Eclipse file refresh, are handled by the default implementation.

Specified by:
createOutputStream in interface URIConverter
Overrides:
createOutputStream in class ExtensibleURIConverterImpl
Parameters:
uri - the URI for which to create the output stream.
options - a map of options to influence the kind of stream that is returned; unrecognized options are ignored and null is permitted.
Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.

createFileOutputStream

protected java.io.OutputStream createFileOutputStream(java.lang.String filePath)
                                               throws java.io.IOException
Deprecated. 
Creates an output stream for the file path and returns it.

This implementation allocates a FileOutputStream and creates subdirectories as necessary.

Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.

createArchiveOutputStream

protected java.io.OutputStream createArchiveOutputStream(URI archiveURI)
                                                  throws java.io.IOException
Deprecated. 
Creates an output stream for the archive access.

Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.

createPlatformResourceOutputStream

protected java.io.OutputStream createPlatformResourceOutputStream(java.lang.String platformResourcePath)
                                                           throws java.io.IOException
Deprecated. 
Creates an output stream for the platform resource path and returns it.

This implementation does one of two things, depending on the runtime environment. If there is an Eclipse workspace, it delegates to WorkbenchHelper.createPlatformResourceOutputStream, which gives the expected Eclipse behaviour. Otherwise, the resolved URI is delegated to createOutputStream for recursive processing.

Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream or a valid interpretation of the path.
See Also:
EcorePlugin.resolvePlatformResourcePath(String)

createEFSOutputStream

protected java.io.OutputStream createEFSOutputStream(URI uri)
                                              throws java.io.IOException
Deprecated. 
Creates an output stream for the URI, assuming it's a URI recognized by the Eclipse File System, and returns it.

Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.

createURLOutputStream

protected java.io.OutputStream createURLOutputStream(URI uri)
                                              throws java.io.IOException
Deprecated. 
Creates an output stream for the URI, assuming it's a URL, and returns it.

Returns:
an open output stream.
Throws:
java.io.IOException - if there is a problem obtaining an open output stream.

createInputStream

public java.io.InputStream createInputStream(URI uri)
                                      throws java.io.IOException
Deprecated. 
Creates an input stream for the URI and returns it.

This implementation normalizes the URI and uses that as the basis for further processing. A file-based URI is converted to a file path, e.g.,

  file:///C:/directory/file
    ->
   C:/directory/file
and is delegated to createFileInputStream. An archive-based URI is delegated to createArchiveInputStream. A platform-based URI is converted to a platform path by trimming the leading platform:/resource, e.g.,
  platform:/resource/project/directory/file 
    ->
  /project/directory/file 
and is delegated to createPlatformResourceInputStream. An EFS-based URI is delegated to createEFSInputStream. And all other cases are handled as standard URLs by createURLInputStream.

Specified by:
createInputStream in interface URIConverter
Overrides:
createInputStream in class ExtensibleURIConverterImpl
Parameters:
uri - the URI for which to create the input stream.
Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.
See Also:
URIConverter.createInputStream(URI, Map)

createInputStream

public java.io.InputStream createInputStream(URI uri,
                                             java.util.Map<?,?> options)
                                      throws java.io.IOException
Deprecated. 
Description copied from interface: URIConverter
Creates an input stream for the URI and returns it.

It normalizes the URI and uses that as the basis for further processing. Special requirements, such as an Eclipse file refresh, are handled by the default implementation.

Specified by:
createInputStream in interface URIConverter
Overrides:
createInputStream in class ExtensibleURIConverterImpl
Parameters:
uri - the URI for which to create the input stream.
options - a map of options to influence the kind of stream that is returned; unrecognized options are ignored and null is permitted.
Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.

createFileInputStream

protected java.io.InputStream createFileInputStream(java.lang.String filePath)
                                             throws java.io.IOException
Deprecated. 
Creates an input stream for the file path and returns it.

This implementation allocates a FileInputStream.

Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.

createArchive

protected URIConverterImpl.Archive createArchive(URI uri)
Deprecated. 

createArchiveInputStream

protected java.io.InputStream createArchiveInputStream(URI archiveURI)
                                                throws java.io.IOException
Deprecated. 
Creates an input stream for the archive paths and returns it. It uses URIConverterImpl.Archive to implement read access.

Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.

createPlatformResourceInputStream

protected java.io.InputStream createPlatformResourceInputStream(java.lang.String platformResourcePath)
                                                         throws java.io.IOException
Deprecated. 
Creates an input stream for the platform resource path and returns it.

This implementation does one of two things, depending on the runtime environment. If there is an Eclipse workspace, it delegates to WorkbenchHelper.createPlatformResourceInputStream, which gives the expected Eclipse behaviour. Otherwise, the resolved URI is delegated to createInputStream for recursive processing.

Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream or a valid interpretation of the path.
See Also:
EcorePlugin.resolvePlatformResourcePath(String)

createEFSInputStream

protected java.io.InputStream createEFSInputStream(URI uri)
                                            throws java.io.IOException
Deprecated. 
Creates an input stream for the URI, assuming it's a URI recognized by the Eclipse File System, and returns it.

Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.

createURLInputStream

protected java.io.InputStream createURLInputStream(URI uri)
                                            throws java.io.IOException
Deprecated. 
Creates an input stream for the URI, assuming it's a URL, and returns it.

Returns:
an open input stream.
Throws:
java.io.IOException - if there is a problem obtaining an open input stream.

getInternalURIMap

@Deprecated
protected URIConverterImpl.URIMap getInternalURIMap()
Deprecated. since 2.4; there should be no need to call this method directly so use ExtensibleURIConverterImpl.getURIMap() instead.

Returns the internal version of the URI map.

Overrides:
getInternalURIMap in class ExtensibleURIConverterImpl
Returns:
the internal version of the URI map.

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