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:
-
Method Summary
Modifier and TypeMethodDescriptionThis allows the MIME type of thisIndex
to be acquired.This is used to acquire theFile
directory for the index target.getFile()
This is used to acquire theFile
reference for the index target.getName()
This allows the name for this object to be acquired.getPath()
This is used to acquire thePath
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 thisIndex
to be acquired. The MIME type of a file is retrieved by theContext.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 theMapper
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 theFile
directory for the index target. This is typically rooted at a base path, for instance theContext
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 theFile
reference for the index target. This is typically rooted at a base path, for instance theContext
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 thePath
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
-