Class LocalFileStorage

  • All Implemented Interfaces:
    IStorage, IAdaptable

    public class LocalFileStorage
    extends PlatformObject
    implements IStorage
    Implementation of storage for a local file (java.io.File).

    This class may be instantiated.

    Since:
    3.0
    See Also:
    IStorage
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalFileStorage​(java.io.File file)
      Constructs and returns storage for the given file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      java.io.InputStream getContents()
      Returns an open input stream on the contents of this storage.
      java.io.File getFile()
      Returns the file associated with this storage
      IPath getFullPath()
      Returns the full path of this storage.
      java.lang.String getName()
      Returns the name of this storage.
      int hashCode()  
      boolean isReadOnly()
      Returns whether this storage is read-only.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalFileStorage

        public LocalFileStorage​(java.io.File file)
        Constructs and returns storage for the given file.
        Parameters:
        file - a local file
    • Method Detail

      • getContents

        public java.io.InputStream getContents()
                                        throws CoreException
        Description copied from interface: IStorage
        Returns an open input stream on the contents of this storage. The caller is responsible for closing the stream when finished.
        Specified by:
        getContents in interface IStorage
        Returns:
        an input stream containing the contents of this storage
        Throws:
        CoreException - if the contents of this storage could not be accessed. See any refinements for more information.
      • getFullPath

        public IPath getFullPath()
        Description copied from interface: IStorage
        Returns the full path of this storage. The returned value depends on the implementor/extender. A storage need not have a path.
        Specified by:
        getFullPath in interface IStorage
        Returns:
        the path related to the data represented by this storage or null if none.
      • getName

        public java.lang.String getName()
        Description copied from interface: IStorage
        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.
        Specified by:
        getName in interface IStorage
        Returns:
        the name of the data represented by this storage, or null if this storage has no name
        See Also:
        IStorage.getFullPath()
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: IStorage
        Returns whether this storage is read-only.
        Specified by:
        isReadOnly in interface IStorage
        Returns:
        true if this storage is read-only
      • getFile

        public java.io.File getFile()
        Returns the file associated with this storage
        Returns:
        file
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object