Copyright (c) 2000, 2009 IBM Corporation and others. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/ SPDX-License-Identifier: EPL-2.0 Contributors: IBM Corporation - initial API and implementation
/******************************************************************************* * Copyright (c) 2000, 2009 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/
package org.eclipse.core.resources; import java.io.InputStream; import org.eclipse.core.runtime.*;
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.

/** * A storage object represents a set of bytes which can be accessed. * These may be in the form of an <code>IFile</code> or <code>IFileState</code> * or any other object supplied by user code. The main role of an <code>IStorage</code> * is to provide a uniform API for access to, and presentation of, its content. * <p> * Storage objects implement the <code>IAdaptable</code> interface; * extensions are managed by the platform's adapter manager. * </p> * <p> * Clients may implement this interface. * </p> */
public interface IStorage extends IAdaptable {
Returns an open input stream on the contents of this storage. The caller is responsible for closing the stream when finished.
Throws:
  • CoreException – if the contents of this storage could not be accessed. See any refinements for more information.
Returns:an input stream containing the contents of this storage
/** * Returns an open input stream on the contents of this storage. * The caller is responsible for closing the stream when finished. * * @return an input stream containing the contents of this storage * @exception CoreException if the contents of this storage could * not be accessed. See any refinements for more information. */
InputStream getContents() throws CoreException;
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.
/** * Returns the full path of this storage. The returned value * depends on the implementor/extender. A storage need not * have a path. * * @return the path related to the data represented by this storage or * <code>null</code> if none. */
IPath getFullPath();
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.
See Also:
Returns:the name of the data represented by this storage, or null if this storage has no name
/** * 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. * * @return the name of the data represented by this storage, * or <code>null</code> if this storage has no name * @see #getFullPath() */
String getName();
Returns whether this storage is read-only.
Returns:true if this storage is read-only
/** * Returns whether this storage is read-only. * * @return <code>true</code> if this storage is read-only */
boolean isReadOnly(); }