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
fileBytes
protected abstract ByteBuffer fileBytes()
throws IOException
- Throws:
IOException
welcomeBytes
protected abstract ByteBuffer welcomeBytes()
throws IOException
- Throws:
IOException
read
protected ByteBuffer read(int length,
InputStream in)
throws IOException
- Throws:
IOException
withoutTrailingSlashOrQuery
protected String withoutTrailingSlashOrQuery(String path)
Copyright © 2012. All Rights Reserved.