public class ResourceStreamAccessorImpl extends AbstractTypedElementAdapter implements IStreamContentAccessor
IStreamContentAccessor
for resources.FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
Constructor and Description |
---|
ResourceStreamAccessorImpl(AdapterFactory adapterFactory,
Resource resource)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getContents()
Returns an open
InputStream for this object which can be used to retrieve the object's
content. |
Image |
getImage()
Returns an image for this object.
|
String |
getName()
Returns the name of this object.
|
String |
getType()
Returns the type of this object.
|
getAdapterFactory, getItemDelegator, getRootAdapterFactory
public ResourceStreamAccessorImpl(AdapterFactory adapterFactory, Resource resource)
adapterFactory
- the adapater factory used to create the accessor.resource
- the Resource to associate with the accessor.public String getName()
getName
in interface ITypedElement
ITypedElement.getName()
public Image getImage()
getImage
in interface ITypedElement
null
if this type of input has no imageITypedElement.getImage()
public String getType()
FOLDER_TYPE
. The type is used for determining a suitable viewer
for this object.getType
in interface ITypedElement
ITypedElement.getType()
public InputStream getContents() throws CoreException
InputStream
for this object which can be used to retrieve the object's
content. The client is responsible for closing the stream when finished. Returns null
if
this object has no streamable contents.getContents
in interface IStreamContentAccessor
CoreException
- if the contents of this object could not be accessedIStreamContentAccessor.getContents()
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.