Interface Entry

All Superinterfaces:
Adaptable

public interface Entry extends Adaptable
An adaptable entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the container this entry lives in..
    long
    Obtain the time that this entry was last modified
    Gets the name of this entry.
    Gets the path of this entry.
    Deprecated.
    added purely to support getRealPath on ServletContext ..
    This method should return a URL suitable for the ServletContext.getResource(String path) method.
    Gets the Container that represents the root of this Entries hierarchy.
    long
    Obtain size of this Entries data, if any.

    Methods inherited from interface com.ibm.wsspi.adaptable.module.Adaptable

    adapt
  • Method Details

    • getName

      String getName()
      Gets the name of this entry.
      Returns:
      name of Entry
    • getPath

      String getPath()
      Gets the path of this entry.
      Returns:
      path of Entry
    • getSize

      long getSize()
      Obtain size of this Entries data, if any.
      Returns:
      number of bytes this Entry represents.
    • getLastModified

      long getLastModified()
      Obtain the time that this entry was last modified
      Returns:
      A long value indicating the last modified time or 0L if the value is not available
    • getResource

      URL getResource()

      This method should return a URL suitable for the ServletContext.getResource(String path) method.

      If this Entry represents a container then this method will not work because some implementations of this API may map more than one location to a single container. Therefore to load all of the locations that contribute to a container you should do:

      Container container = entry.convertToContainer();
      if (container != null) {
        Collection<URI> allUrisForContainer = container.getUri();
      }

      This may return null if this Entry is a virtual container that does not have a real location on disk.

      Returns:
      The URL pointing to this entry on disk
    • getPhysicalPath

      @Deprecated String getPhysicalPath()
      Deprecated.
      added purely to support getRealPath on ServletContext ..

      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.
    • getEnclosingContainer

      Container getEnclosingContainer()
      Gets the container this entry lives in..
      Returns:
      container this entry lives in..
    • getRoot

      Container getRoot()
      Gets the Container that represents the root of this Entries hierarchy. eg. the Container with path "/".
      Returns:
      container representing /