org.webbitserver.handler
Class AbstractResourceHandler.IOWorker
java.lang.Object
org.webbitserver.handler.AbstractResourceHandler.IOWorker
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- EmbeddedResourceHandler.ResourceWorker, StaticFileHandler.FileWorker
- Enclosing class:
- AbstractResourceHandler
protected abstract class AbstractResourceHandler.IOWorker
- extends Object
- implements Runnable
All IO is performed by this worker on a separate thread, so we never block the HttpHandler.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
path
protected String path
response
protected final HttpResponse response
control
protected final HttpControl control
AbstractResourceHandler.IOWorker
protected AbstractResourceHandler.IOWorker(String path,
HttpRequest request,
HttpResponse response,
HttpControl control)
notFound
protected void notFound()
error
protected void error(IOException exception)
run
public void run()
- Specified by:
run in interface Runnable
exists
protected abstract boolean exists()
throws IOException
- Throws:
IOException
isDirectory
protected abstract boolean isDirectory()
throws IOException
- Throws:
IOException
fileBytes
protected abstract byte[] fileBytes()
throws IOException
- Throws:
IOException
welcomeBytes
protected abstract byte[] welcomeBytes()
throws IOException
- Throws:
IOException
directoryListingBytes
protected abstract byte[] directoryListingBytes()
throws IOException
- Throws:
IOException
read
protected byte[] read(int length,
InputStream in)
throws IOException
- Throws:
IOException
withoutQuery
protected String withoutQuery(String path)
extractQuery
protected String extractQuery(String path)
Copyright © 2012. All Rights Reserved.