org.eclipse.jdt.internal.core
Class NonJavaResource

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.jdt.internal.core.NonJavaResource
All Implemented Interfaces:
IStorage, org.eclipse.core.runtime.IAdaptable, IJarEntryResource

public class NonJavaResource
extends org.eclipse.core.runtime.PlatformObject
implements IJarEntryResource


Constructor Summary
NonJavaResource(java.lang.Object parent, IResource resource)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 IJarEntryResource[] getChildren()
          Returns the list of children of this jar entry resource.
 java.io.InputStream getContents()
          Returns an open input stream on the contents of this storage.
 org.eclipse.core.runtime.IPath getFullPath()
          Returns the full, absolute path of this jar entry resource relative to the archive this jar entry belongs to.
 java.lang.String getName()
          Returns the name of this storage.
 IPackageFragmentRoot getPackageFragmentRoot()
          Returns the package fragment root this jar entry resource belongs to.
 java.lang.Object getParent()
          Returns the parent of this jar entry resource.
 int hashCode()
           
 boolean isFile()
          Returns true if this jar entry represents a file.
 boolean isReadOnly()
          Returns whether this storage is read-only.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

NonJavaResource

public NonJavaResource(java.lang.Object parent,
                       IResource resource)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getChildren

public IJarEntryResource[] getChildren()
Description copied from interface: IJarEntryResource
Returns the list of children of this jar entry resource. Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children.

Specified by:
getChildren in interface IJarEntryResource
Returns:
the children of this jar entry resource

getContents

public java.io.InputStream getContents()
                                throws org.eclipse.core.runtime.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:
org.eclipse.core.runtime.CoreException - if the contents of this storage could not be accessed. See any refinements for more information.

getFullPath

public org.eclipse.core.runtime.IPath getFullPath()
Description copied from interface: IJarEntryResource
Returns the full, absolute path of this jar entry resource relative to the archive this jar entry belongs to.

A jar entry resource's full path indicates the route from the root of the archive to the jar entry resource. Within an archive, there is exactly one such path for any given jar entry resource.

The returned path is absolute (i.e. it starts with a separator) and it never has a trailing separator.

Specified by:
getFullPath in interface IStorage
Specified by:
getFullPath in interface IJarEntryResource
Returns:
the absolute path of this jar entry resource

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()

getPackageFragmentRoot

public IPackageFragmentRoot getPackageFragmentRoot()
Description copied from interface: IJarEntryResource
Returns the package fragment root this jar entry resource belongs to.

Specified by:
getPackageFragmentRoot in interface IJarEntryResource
Returns:
the package fragment root this jar entry resource belongs to.

getParent

public java.lang.Object getParent()
Description copied from interface: IJarEntryResource
Returns the parent of this jar entry resource. This is either an IJarEntryResource, an IPackageFragment or an IPackageFragmentRoot.

Specified by:
getParent in interface IJarEntryResource
Returns:
the parent of this jar entry resource

hashCode

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

isFile

public boolean isFile()
Description copied from interface: IJarEntryResource
Returns true if this jar entry represents a file. Returns false if it is a directory.

Specified by:
isFile in interface IJarEntryResource
Returns:
whether this jar entry is a file

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object