|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.httpd.resource.AbstractResource
public abstract class AbstractResource
Constructor Summary | |
---|---|
AbstractResource(HTTPHandler handler,
CustomLogger logger,
boolean useFairLocks)
Create a new AbstractResource. |
Method Summary | |
---|---|
abstract boolean |
close()
Closes this resource. |
HTTPHandler |
getHTTPHandler()
Get the global HTTP handler. |
HypertextAccessFile |
getHypertextAccessFile()
Get the resource's hypertext access file settings. |
abstract java.io.InputStream |
getInputStream()
Get the input stream from this resource. |
abstract long |
getLength()
This method returns the *actual* length of the underlying resource. |
CustomLogger |
getLogger()
|
ResourceMetaData |
getMetaData()
Get the meta data for this resource. |
abstract java.io.OutputStream |
getOutputStream()
Get the output stream to this resource. |
java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock |
getReadLock()
This method returns the read lock for this resource. |
java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock |
getWriteLock()
This method returns the write lock for this resource. |
abstract boolean |
isOpen()
This method determines if this resource was alerady opened or not. |
abstract boolean |
isReadOnly()
This method returns true if the underlying resource is read-only (in general). |
abstract void |
open(boolean readOnly)
This method opens the underlying resource. |
protected void |
setHypertextAccessFile(HypertextAccessFile hypertextAccessFile)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractResource(HTTPHandler handler, CustomLogger logger, boolean useFairLocks)
Method Detail |
---|
public HTTPHandler getHTTPHandler()
public CustomLogger getLogger()
protected void setHypertextAccessFile(HypertextAccessFile hypertextAccessFile)
public ResourceMetaData getMetaData()
getMetaData
in interface Resource
public HypertextAccessFile getHypertextAccessFile()
getHypertextAccessFile
in interface Resource
public java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock getReadLock()
getReadLock
in interface Resource
public java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getWriteLock()
getWriteLock
in interface Resource
public abstract void open(boolean readOnly) throws java.io.IOException
open
in interface Resource
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 abstract boolean isOpen() throws java.io.IOException
isOpen
in interface Resource
java.io.IOException
- If any IO error occurs.public abstract boolean isReadOnly() throws java.io.IOException
isReadOnly
in interface Resource
java.io.IOException
- If any IO error occurs.public abstract long getLength() throws java.io.IOException
getLength
in interface Resource
java.io.IOException
- If any IO error occurs.public abstract java.io.OutputStream getOutputStream() throws ReadOnlyException, java.io.IOException
getOutputStream
in interface Resource
ReadOnlyException
- If this resource was opened with the read-only flag set.
java.io.IOException
- If any other IO error occurs.public abstract java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface Resource
java.io.IOException
- If any IO error occurs.public abstract boolean close() throws java.io.IOException
close
in interface Resource
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |