| simple.http.serve.Index
All known Subclasses: simple.http.serve.FileIndex,
Index | public interface Index (Code) | | 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: simple.http.serve.Indexer |
Method Summary | |
public String | getContentType() This allows the MIME type of this Index to
be acquired. | public File | getDirectory() This is used to acquire the File directory
for the index target. | public File | getFile() This is used to acquire the File reference
for the index target. | public Locale | getLocale() This gets the locale for this index object the locale is
set to the Locale.getDefault if there is no
locale information available for the index target. | public String | getName() This allows the name for this object to be acquired. | public Path | getPath() This is used to acquire the Path object that
exposes various parts of the URI path. | public String | getRealPath() This is used to get the path that this object refers to. | public String | getRequestPath() This is used to acquire the normalized URI style path for
the index target. |
getContentType | public String getContentType()(Code) | | 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".
the MIME type this object has been set to |
getDirectory | public File getDirectory()(Code) | | 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.
this returns the OS file for the directory |
getFile | public File getFile()(Code) | | 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.
this returns the OS file for the resource |
getLocale | public Locale getLocale()(Code) | | This gets the locale for this index object the locale is
set to the Locale.getDefault if there is no
locale information available for the index target. This
will provide the Context.getLocale object.
this returns the locale for this index target |
getName | public String getName()(Code) | | 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".
this returns the name of this index target |
getPath | public Path getPath()(Code) | | 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.
this returns a path object with various details |
getRealPath | public String getRealPath()(Code) | | 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.
this returns the OS specific path for the target |
getRequestPath | public String getRequestPath()(Code) | | 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.
this returns the normalized path for the target |
|
|