|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.httpd.resource.AbstractResource ikrs.httpd.resource.AbstractDirectoryResource
public abstract class AbstractDirectoryResource
Constructor Summary | |
---|---|
AbstractDirectoryResource(HTTPHandler handler,
CustomLogger logger,
HTTPFileFilter fileFilter,
java.io.File dir,
java.net.URI requestURI,
java.util.UUID sid,
boolean useFairLocks)
Create a new AbstractDirectoryResource. |
Method Summary | |
---|---|
boolean |
close()
Closes this resource. |
abstract void |
generateDirectoryListing(java.util.UUID sid,
java.io.OutputStream out)
This method is designated to build the data for the directory listing. |
java.text.DateFormat |
getDateFormat()
Get the date format to use. |
java.io.File |
getDirectoryFile()
Get the actual directory to generate the listing for. |
abstract MIMEType |
getDirectoryListingType()
This method returns the Content-Type this class generates. |
HTTPFileFilter |
getFileFilter()
Get the file filter to use for directory listing. |
java.io.InputStream |
getInputStream()
Get the input stream from this resource. |
long |
getLength()
This method returns the *actual* length of the underlying resource. |
java.io.OutputStream |
getOutputStream()
Get the output stream to this resource. |
java.net.URI |
getRequestURI()
Get the URI the directory file was requested through. |
boolean |
isOpen()
This method determines if this resource was alerady opened or not. |
boolean |
isReadOnly()
This method returns true if the underlying resource is read-only (in general). |
void |
open(boolean readOnly)
This method opens the underlying resource. |
Methods inherited from class ikrs.httpd.resource.AbstractResource |
---|
getHTTPHandler, getHypertextAccessFile, getLogger, getMetaData, getReadLock, getWriteLock, setHypertextAccessFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ikrs.httpd.Resource |
---|
getHypertextAccessFile, getMetaData, getReadLock, getWriteLock |
Constructor Detail |
---|
public AbstractDirectoryResource(HTTPHandler handler, CustomLogger logger, HTTPFileFilter fileFilter, java.io.File dir, java.net.URI requestURI, java.util.UUID sid, boolean useFairLocks) throws java.lang.NullPointerException
logger
- A custom logger to write log messages to.fileFilter
- The file filter to use.dir
- The directory.requestURI
- The uri from the request (will be used to avoid printing the absolute file path).useFairLocks
- If set to true the created resource will use fair locks.
java.lang.NullPointerException
Method Detail |
---|
public abstract void generateDirectoryListing(java.util.UUID sid, java.io.OutputStream out) throws java.io.IOException
generateDirectoryListing
in interface DirectoryResource
sid
- The current session's ID.out
- The output stream to write the list data to.
java.io.IOException
- If any IO errors occur.public abstract MIMEType getDirectoryListingType()
getDirectoryListingType
in interface DirectoryResource
public java.io.File getDirectoryFile()
public java.net.URI getRequestURI()
public java.text.DateFormat getDateFormat()
public HTTPFileFilter getFileFilter()
public boolean isOpen() throws java.io.IOException
isOpen
in interface Resource
isOpen
in class AbstractResource
java.io.IOException
- If any IO error occurs.public void open(boolean readOnly) throws ReadOnlyException, java.io.IOException
open
in interface Resource
open
in class AbstractResource
readOnly
- if set to true, the resource will be opned in read-only mode.
ReadOnlyException
- If the underlying resource is read-only in general.
java.io.IOException
- If any other IO error occurs.isReadOnly()
public boolean isReadOnly() throws java.io.IOException
isReadOnly
in interface Resource
isReadOnly
in class AbstractResource
java.io.IOException
- If any IO error occurs.public long getLength() throws java.io.IOException
getLength
in interface Resource
getLength
in class AbstractResource
java.io.IOException
- If any IO error occurs.public java.io.OutputStream getOutputStream() throws ReadOnlyException, java.io.IOException
getOutputStream
in interface Resource
getOutputStream
in class AbstractResource
ReadOnlyException
- If this resource was opened with the read-only flag set.
java.io.IOException
- If any other IO error occurs.public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface Resource
getInputStream
in class AbstractResource
java.io.IOException
- If any IO error occurs.public boolean close() throws java.io.IOException
close
in interface Resource
close
in class AbstractResource
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |