public abstract class AbstractPath
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
AbstractPath() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canRead(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the file can be read.
|
void |
destroy()
Cleans up when no longer needed.
|
abstract 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.
|
abstract long |
getLastModified(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns the last modified time of the named file.
|
abstract long |
getLength(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns the length of the named file.
|
abstract boolean |
isDirectory(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the named file is a directory.
|
abstract boolean |
isFile(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns true if the named file is a file.
|
abstract java.lang.String[] |
list(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Returns a list of the files in the directory.
|
abstract boolean |
mkdir(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Creates the named directory.
|
abstract java.io.InputStream |
openRead(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Opens an InputStream for reading
|
abstract java.io.OutputStream |
openWrite(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Opens an OutputStream for writing.
|
abstract boolean |
remove(java.lang.String path,
HttpServletRequest request,
ServletContext app)
Deletes the file
|
boolean |
removeAttribute(AttributeName name,
java.lang.String path,
HttpServletRequest request,
ServletContext app)
Removes an attribute value.
|
boolean |
rename(java.lang.String path,
java.lang.String destination,
HttpServletRequest request,
ServletContext app)
Renames the file without forcing a copy.
|
abstract 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.
|
public abstract boolean isFile(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean isDirectory(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean canRead(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean exists(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract long getLength(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract long getLastModified(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
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
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
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
name
- the attribute namevalue
- the attribute valuepath
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean removeAttribute(AttributeName 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 abstract java.lang.String[] list(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean mkdir(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean rmdir(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public boolean rename(java.lang.String path, java.lang.String destination, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathdestination
- the new namerequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract boolean remove(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract java.io.OutputStream openWrite(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public abstract java.io.InputStream openRead(java.lang.String path, HttpServletRequest request, ServletContext app) throws java.io.IOException
path
- the requested relative pathrequest
- the servlet requestapp
- the servlet contextjava.io.IOException
public void destroy()