mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Reformat using 120 character line width rather than 80.
This commit is contained in:
@@ -54,8 +54,7 @@ public final class HttpRequestWorker extends RequestWorker<HttpRequest, Resource
|
||||
* @param fs The file system.
|
||||
*/
|
||||
public HttpRequestWorker(UpdateDispatcher dispatcher, IndexedFileSystem fs) {
|
||||
super(dispatcher, new CombinedResourceProvider(new VirtualResourceProvider(fs), new HypertextResourceProvider(
|
||||
WWW_DIRECTORY)));
|
||||
super(dispatcher, new CombinedResourceProvider(new VirtualResourceProvider(fs), new HypertextResourceProvider(WWW_DIRECTORY)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,7 +127,7 @@ public final class HttpRequestWorker extends RequestWorker<HttpRequest, Resource
|
||||
status = HttpResponseStatus.NOT_FOUND;
|
||||
mime = "text/html";
|
||||
}
|
||||
|
||||
|
||||
ByteBuf wrapped = buf.isPresent() ? Unpooled.wrappedBuffer(buf.get()) : createErrorPage(status, "The page you requested could not be found.");
|
||||
|
||||
HttpResponse response = new DefaultHttpResponse(request.getProtocolVersion(), status);
|
||||
|
||||
@@ -22,8 +22,7 @@ public final class HypertextResourceProvider implements ResourceProvider {
|
||||
private final Path base;
|
||||
|
||||
/**
|
||||
* Creates a new hypertext resource provider with the specified base
|
||||
* directory.
|
||||
* Creates a new hypertext resource provider with the specified base directory.
|
||||
*
|
||||
* @param base The base directory.
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,7 @@ public interface ResourceProvider {
|
||||
* Checks that this provider can fulfil a request to the specified resource.
|
||||
*
|
||||
* @param path The path to the resource, e.g. {@code /crc}.
|
||||
* @return {@code true} if the provider can fulfil a request to the
|
||||
* resource, {@code false} otherwise.
|
||||
* @return {@code true} if the provider can fulfil a request to the resource, {@code false} otherwise.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
*/
|
||||
public boolean accept(String path) throws IOException;
|
||||
@@ -25,8 +24,8 @@ public interface ResourceProvider {
|
||||
* Returns a resource as a {@link ByteBuffer} if it exists.
|
||||
*
|
||||
* @param path The path to the resource.
|
||||
* @return A {@code ByteBuffer} representation of a resource if it exists
|
||||
* otherwise {@link Optional#empty()} is returned.
|
||||
* @return A {@code ByteBuffer} representation of a resource if it exists otherwise {@link Optional#empty()} is
|
||||
* returned.
|
||||
* @throws IOException If some I/O exception occurs.
|
||||
*/
|
||||
public Optional<ByteBuffer> get(String path) throws IOException;
|
||||
|
||||
@@ -10,8 +10,8 @@ import java.util.Optional;
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
|
||||
/**
|
||||
* A {@link ResourceProvider} which maps virtual resources (such as
|
||||
* {@code /media}) to files in an {@link IndexedFileSystem}.
|
||||
* A {@link ResourceProvider} which maps virtual resources (such as {@code /media}) to files in an
|
||||
* {@link IndexedFileSystem}.
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user