Interface Index
-
public interface IndexTheIndexobject 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 anIndexer. This will contain all necessary meta data for a file or resource. With this theFilereference 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetContentType()This allows the MIME type of thisIndexto be acquired.java.io.FilegetDirectory()This is used to acquire theFiledirectory for the index target.java.io.FilegetFile()This is used to acquire theFilereference for the index target.java.lang.StringgetName()This allows the name for this object to be acquired.PathgetPath()This is used to acquire thePathobject that exposes various parts of the URI path.java.lang.StringgetRealPath()This is used to get the path that this object refers to.java.lang.StringgetRequestPath()This is used to acquire the normalized URI style path for the index target.
-
-
-
Method Detail
-
getName
java.lang.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
java.lang.String getContentType()
This allows the MIME type of thisIndexto be acquired. The MIME type of a file is retrieved by theContext.getContentTypemethod 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
java.lang.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
java.lang.String getRequestPath()
This is used to acquire the normalized URI style path for the index target. This allows the path to be used within theMapperand other such objects that need a normalized URI style path to resolve resources.- Returns:
- this returns the normalized path for the target
-
getDirectory
java.io.File getDirectory()
This is used to acquire theFiledirectory for the index target. This is typically rooted at a base path, for instance theContextroot is typically used. This allows resources within the same directory to be acquired easily.- Returns:
- this returns the OS file for the directory
-
getFile
java.io.File getFile()
This is used to acquire theFilereference for the index target. This is typically rooted at a base path, for instance theContextroot 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 thePathobject 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
-
-