Interface Index


public interface Index
The Index object is used to represent the properties a URI can contain. This is used so that properties relating to a file can be quickly extracted from an Indexer. This will contain all necessary meta data for a file or resource. With this the File reference to a resource as well as the locale, MIME type, name and other such data can be accessed.
Author:
Niall Gallagher
See Also:
  • Indexer
  • Method Summary

    Modifier and Type
    Method
    Description
    This allows the MIME type of this Index to be acquired.
    This is used to acquire the File directory for the index target.
    This is used to acquire the File reference for the index target.
    This allows the name for this object to be acquired.
    This is used to acquire the Path object that exposes various parts of the URI path.
    This is used to get the path that this object refers to.
    This is used to acquire the normalized URI style path for the index target.
  • Method Details

    • getName

      String getName()
      This allows the name for this object to be acquired. The name usually refers to the last entry in the path. So if the index target path was "/usr/bin/" the name is "bin".
      Returns:
      this returns the name of this index target
    • getContentType

      String getContentType()
      This allows the MIME type of this Index to be acquired. The MIME type of a file is retrieved by the Context.getContentType method for a specific request URI. This should have a value and perhaps some parameters like the charset, "text/html; charset=UTF-8".
      Returns:
      the MIME type this object has been set to
    • getRealPath

      String getRealPath()
      This is used to get the path that this object refers to. This should be the fully qualified normalized path. This refers to the OS system specific path that this represents.
      Returns:
      this returns the OS specific path for the target
    • getRequestPath

      String getRequestPath()
      This is used to acquire the normalized URI style path for the index target. This allows the path to be used within the Mapper and other such objects that need a normalized URI style path to resolve resources.
      Returns:
      this returns the normalized path for the target
    • getDirectory

      File getDirectory()
      This is used to acquire the File directory for the index target. This is typically rooted at a base path, for instance the Context root is typically used. This allows resources within the same directory to be acquired easily.
      Returns:
      this returns the OS file for the directory
    • getFile

      File getFile()
      This is used to acquire the File reference for the index target. This is typically rooted at a base path, for instance the Context root is typically used. This allows the file to be opened, deleted, or read should the need arise in a service.
      Returns:
      this returns the OS file for the resource
    • getPath

      Path getPath()
      This is used to acquire the Path object that exposes various parts of the URI path. This can be used to extract the individual path segments as strings as well as the file extension and various other details.
      Returns:
      this returns a path object with various details