public class ApplicationPath extends AbstractPath
log
Constructor and Description |
---|
ApplicationPath() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the file can be read.
|
boolean |
exists(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the file exists.
|
java.lang.String |
getAttribute(AttributeName name,
java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns an attribute value.
|
java.util.Iterator |
getAttributeNames(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns an iterator over the attribute names.
|
long |
getLastModified(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns the last modified time of the named file.
|
long |
getLength(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns the length of the named file.
|
protected Path |
getPath(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns the underlying path.
|
boolean |
isDirectory(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the named file is a directory.
|
boolean |
isFile(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the named file is a file.
|
java.lang.String[] |
list(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns a list of the files in the directory.
|
boolean |
mkdir(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Creates the named directory.
|
java.io.InputStream |
openRead(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Opens an InputStream for reading
|
java.io.OutputStream |
openWrite(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Opens an OutputStream for writing.
|
boolean |
remove(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Deletes the file
|
void |
removeAttribute(java.lang.String name,
java.lang.String path,
HttpServletRequest request,
ServletContext app)
Removes an attribute value.
|
boolean |
rmdir(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Removes the named directory.
|
boolean |
setAttribute(AttributeName name,
java.lang.String value,
java.lang.String path,
HttpServletRequest request,
ServletContext app)
Sets an attribute value.
|
destroy, removeAttribute, rename
public boolean isFile(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
isFile
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean isDirectory(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
isDirectory
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean canRead(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
canRead
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean exists(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
exists
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public long getLength(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
getLength
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public long getLastModified(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
getLastModified
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public java.util.Iterator getAttributeNames(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
getAttributeNames
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public java.lang.String getAttribute(AttributeName name, java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
getAttribute
in class AbstractPath
name
- the attribute namepath
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean setAttribute(AttributeName name, java.lang.String value, java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
setAttribute
in class AbstractPath
name
- the attribute namevalue
- the attribute valuepath
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public void removeAttribute(java.lang.String name, java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
name
- the attribute namepath
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public java.lang.String[] list(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
list
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean mkdir(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
mkdir
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean rmdir(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
rmdir
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean remove(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
remove
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public java.io.OutputStream openWrite(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
openWrite
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public java.io.InputStream openRead(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
openRead
in class AbstractPath
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
protected Path getPath(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
java.io.IOException