public class PlatformResourceURIHandlerImpl extends URIHandlerImpl
| Modifier and Type | Class and Description |
|---|---|
static class |
PlatformResourceURIHandlerImpl.PlatformResourceOutputStream
An output stream that transfers its contents to an
IFile upon closing. |
static class |
PlatformResourceURIHandlerImpl.WorkbenchHelper
Isolated Eclipse workbench utilities.
|
| Modifier and Type | Field and Description |
|---|---|
protected static IWorkspaceRoot |
workspaceRoot
The cached Eclipse workspace.
|
DEFAULT_HANDLERS| Constructor and Description |
|---|
PlatformResourceURIHandlerImpl()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(URI uri)
This implementation always returns true; clients are generally expected to override this.
|
java.io.InputStream |
createInputStream(URI uri,
java.util.Map<?,?> options)
Creates an input stream for the platform resource path and returns it.
|
java.io.OutputStream |
createOutputStream(URI uri,
java.util.Map<?,?> options)
Creates an output stream for the platform resource path and returns it.
|
void |
delete(URI uri,
java.util.Map<?,?> options)
Only HTTP connections support delete.
|
boolean |
exists(URI uri,
java.util.Map<?,?> options)
If a stream can be created the file exists.
|
java.util.Map<java.lang.String,?> |
getAttributes(URI uri,
java.util.Map<?,?> options)
Returns a map from String attributes to their corresponding values representing information about various aspects of the URI's state.
|
void |
setAttributes(URI uri,
java.util.Map<java.lang.String,?> attributes,
java.util.Map<?,?> options)
Updates the map from String attributes to their corresponding values representing information about various aspects of the URI's state.
|
contentDescription, getRequestedAttributes, getResponse, getTimeout, getURIConverterprotected static IWorkspaceRoot workspaceRoot
public PlatformResourceURIHandlerImpl()
public boolean canHandle(URI uri)
URIHandlerImplcanHandle in interface URIHandlercanHandle in class URIHandlerImpluri - the URI to consider.public java.io.OutputStream createOutputStream(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
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.
createOutputStream in interface URIHandlercreateOutputStream in class URIHandlerImpluri - 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 not permitted.java.io.IOException - if there is a problem obtaining an open output stream or a valid interpretation of the path.EcorePlugin.resolvePlatformResourcePath(String)public java.io.InputStream createInputStream(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
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.
createInputStream in interface URIHandlercreateInputStream in class URIHandlerImpluri - 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 not permitted.java.io.IOException - if there is a problem obtaining an open input stream or a valid interpretation of the path.EcorePlugin.resolvePlatformResourcePath(String)public void delete(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
URIHandlerImpldelete in interface URIHandlerdelete in class URIHandlerImpluri - the URI to consider.options - options to influence how the contents are deleted; unrecognized options are ignored and null is not permitted.java.io.IOException - if there is a problem deleting the contents.URIConverter.delete(URI, Map)public boolean exists(URI uri,
java.util.Map<?,?> options)
URIHandlerImplexists in interface URIHandlerexists in class URIHandlerImpluri - the URI to consider.options - options to influence how the existence determined; unrecognized options are ignored and null is not permitted.URIConverter.exists(URI, Map)public java.util.Map<java.lang.String,?> getAttributes(URI uri,
java.util.Map<?,?> options)
URIHandlerrequested attributes option can be used to specify which properties to fetch;
without that option, all supported attributes will be fetched.
If the URI doesn't not support any particular attribute, an entry for that attribute will not be appear in the result.getAttributes in interface URIHandlergetAttributes in class URIHandlerImpluri - the URI to consider.options - options to influence how the attributes are determined; unrecognized options are ignored and null is not permitted.public void setAttributes(URI uri,
java.util.Map<java.lang.String,?> attributes,
java.util.Map<?,?> options)
throws java.io.IOException
URIHandlersetAttributes in interface URIHandlersetAttributes in class URIHandlerImpluri - the URI to consider.attributes - the new values for the attributes.options - options to influence how the attributes are updated; unrecognized options are ignored and null is not permitted.java.io.IOException - if there is a problem updating the attributes.Copyright © 2018. Licensed under the Eclipse Public License v1.0. All rights reserved.
Submit a bug or feature