com.ibm.wsspi.adaptable.module

Interface Container

All Superinterfaces:
Adaptable, java.lang.Iterable<Entry>
All known subinterfaces:
InterpretedContainer

  1. public interface Container
  2. extends Adaptable, java.lang.Iterable<Entry>
An adaptable container.

Method Summary

Modifier and Type Method and Description
  1. Container
getEnclosingContainer()
Get the Container that encloses this one.
  1. Entry
getEntry(java.lang.String pathAndName)
Obtain adaptable entry from this container.
Path may be relative to this node, or absolute to the local root.
Local root is the 'enclosingContainer' above this Container in the hierarchy, that returns true for 'isRoot'.
  1. java.lang.String
getName()
Get name for this Container.
  1. java.lang.String
getPath()
Get path for this Container.
  1. java.lang.String
getPhysicalPath()
Deprecated. added purely to support getRealPath on ServletContext .. post alpha this will need replacing.
  1. Container
getRoot()
Gets the Container that represents the root of this Entries hierarchy.
  1. java.util.Collection<java.net.URL>
getURLs()
This may not be implemented by all implementations of this interface and it should never return null but should return an empty collection instead.
  1. boolean
isRoot()
True if this Container represents a root for paths.
Methods inherited from interface com.ibm.wsspi.adaptable.module.Adaptable
adapt
Methods inherited from interface java.lang.Iterable
iterator

Method Detail

getEntry

  1. Entry getEntry(java.lang.String pathAndName)
Obtain adaptable entry from this container.
Path may be relative to this node, or absolute to the local root.
Local root is the 'enclosingContainer' above this Container in the hierarchy, that returns true for 'isRoot'.
Parameters:
pathAndName - path to obtain entry at.
Returns:
Entry if located, null otherwise.

getName

  1. java.lang.String getName()
Get name for this Container.

eg. /wibble/fish will give fish, /wibble will give wibble

Returns:
name of this Container

getPath

  1. java.lang.String getPath()
Get path for this Container.
Returns:
path for this Container.

getEnclosingContainer

  1. Container getEnclosingContainer( )
Get the Container that encloses this one.

Even containers that return true for isRoot, may return an enclosing Container.
Eg. a Jar within a directory, the jar will return true for isRoot, and it's enclosing container would be the directory.

Returns:
the Container enclosing this one, or null if there is none.

isRoot

  1. boolean isRoot()
True if this Container represents a root for paths.

Even containers that return true for isRoot, may still be enclosed by another Container. Eg. a Jar within a directory, the jar will return true for isRoot, and it's enclosing container would be the directory.

Returns:
true if this Container is a root, false otherwise.

getRoot

  1. Container getRoot()
Gets the Container that represents the root of this Entries hierarchy. eg. the Container with path "/".
Returns:
container representing / (or self, if this isRoot=true)

getURLs

  1. java.util.Collection<java.net.URL> getURLs( )
This may not be implemented by all implementations of this interface and it should never return null but should return an empty collection instead.
Returns:
A collection of URLs that represent all of the locations on disk that contribute to this container
Throws:
java.lang.UnsupportedOperationException - if the implementation does not support this method

getPhysicalPath

  1. @Deprecated
  2. java.lang.String getPhysicalPath( )
Deprecated. added purely to support getRealPath on ServletContext .. post alpha this will need replacing.

Get path for this Entity. Not all implementations of this interface need to support this method and should return null if they do not support them.

If the entry is container within an archive file such as a JAR or ZIP then this will return null.

For directories that have more than one physical location mapped to them then this will return the first mapped resource.

Returns:
String representing physical path on disk for this entity.. null if there is none. null is very possible.