org.eclipse.core.resources
Interface IStorage

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
All Known Subinterfaces:
IEncodedStorage, IFile, IFileState, IJarEntryResource
All Known Implementing Classes:
File, FileState, JarEntryDirectory, JarEntryFile, JarEntryResource, NonJavaResource

public interface IStorage
extends org.eclipse.core.runtime.IAdaptable

A storage object represents a set of bytes which can be accessed. These may be in the form of an IFile or IFileState or any other object supplied by user code. The main role of an IStorage is to provide a uniform API for access to, and presentation of, its content.

Storage objects implement the IAdaptable interface; extensions are managed by the platform's adapter manager.

Clients may implement this interface.


Method Summary
 java.io.InputStream getContents()
          Returns an open input stream on the contents of this storage.
 org.eclipse.core.runtime.IPath getFullPath()
          Returns the full path of this storage.
 java.lang.String getName()
          Returns the name of this storage.
 boolean isReadOnly()
          Returns whether this storage is read-only.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

getContents

java.io.InputStream getContents()
                                throws org.eclipse.core.runtime.CoreException
Returns an open input stream on the contents of this storage. The caller is responsible for closing the stream when finished.

Returns:
an input stream containing the contents of this storage
Throws:
org.eclipse.core.runtime.CoreException - if the contents of this storage could not be accessed. See any refinements for more information.

getFullPath

org.eclipse.core.runtime.IPath getFullPath()
Returns the full path of this storage. The returned value depends on the implementor/extender. A storage need not have a path.

Returns:
the path related to the data represented by this storage or null if none.

getName

java.lang.String getName()
Returns the name of this storage. The name of a storage is synonymous with the last segment of its full path though if the storage does not have a path, it may still have a name.

Returns:
the name of the data represented by this storage, or null if this storage has no name
See Also:
getFullPath()

isReadOnly

boolean isReadOnly()
Returns whether this storage is read-only.

Returns:
true if this storage is read-only