Reformat using 120 character line width rather than 80.

This commit is contained in:
Ryley Kimmel
2015-02-27 13:18:44 -05:00
parent 46ffb75626
commit da967209c0
4 changed files with 8 additions and 11 deletions
+2 -3
View File
@@ -54,8 +54,7 @@ public final class HttpRequestWorker extends RequestWorker<HttpRequest, Resource
* @param fs The file system. * @param fs The file system.
*/ */
public HttpRequestWorker(UpdateDispatcher dispatcher, IndexedFileSystem fs) { public HttpRequestWorker(UpdateDispatcher dispatcher, IndexedFileSystem fs) {
super(dispatcher, new CombinedResourceProvider(new VirtualResourceProvider(fs), new HypertextResourceProvider( super(dispatcher, new CombinedResourceProvider(new VirtualResourceProvider(fs), new HypertextResourceProvider(WWW_DIRECTORY)));
WWW_DIRECTORY)));
} }
/** /**
@@ -128,7 +127,7 @@ public final class HttpRequestWorker extends RequestWorker<HttpRequest, Resource
status = HttpResponseStatus.NOT_FOUND; status = HttpResponseStatus.NOT_FOUND;
mime = "text/html"; mime = "text/html";
} }
ByteBuf wrapped = buf.isPresent() ? Unpooled.wrappedBuffer(buf.get()) : createErrorPage(status, "The page you requested could not be found."); 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); HttpResponse response = new DefaultHttpResponse(request.getProtocolVersion(), status);
@@ -22,8 +22,7 @@ public final class HypertextResourceProvider implements ResourceProvider {
private final Path base; private final Path base;
/** /**
* Creates a new hypertext resource provider with the specified base * Creates a new hypertext resource provider with the specified base directory.
* directory.
* *
* @param base The 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. * Checks that this provider can fulfil a request to the specified resource.
* *
* @param path The path to the resource, e.g. {@code /crc}. * @param path The path to the resource, e.g. {@code /crc}.
* @return {@code true} if the provider can fulfil a request to the * @return {@code true} if the provider can fulfil a request to the resource, {@code false} otherwise.
* resource, {@code false} otherwise.
* @throws IOException If an I/O error occurs. * @throws IOException If an I/O error occurs.
*/ */
public boolean accept(String path) throws IOException; public boolean accept(String path) throws IOException;
@@ -25,8 +24,8 @@ public interface ResourceProvider {
* Returns a resource as a {@link ByteBuffer} if it exists. * Returns a resource as a {@link ByteBuffer} if it exists.
* *
* @param path The path to the resource. * @param path The path to the resource.
* @return A {@code ByteBuffer} representation of a resource if it exists * @return A {@code ByteBuffer} representation of a resource if it exists otherwise {@link Optional#empty()} is
* otherwise {@link Optional#empty()} is returned. * returned.
* @throws IOException If some I/O exception occurs. * @throws IOException If some I/O exception occurs.
*/ */
public Optional<ByteBuffer> get(String path) throws IOException; public Optional<ByteBuffer> get(String path) throws IOException;
@@ -10,8 +10,8 @@ import java.util.Optional;
import org.apollo.fs.IndexedFileSystem; import org.apollo.fs.IndexedFileSystem;
/** /**
* A {@link ResourceProvider} which maps virtual resources (such as * A {@link ResourceProvider} which maps virtual resources (such as {@code /media}) to files in an
* {@code /media}) to files in an {@link IndexedFileSystem}. * {@link IndexedFileSystem}.
* *
* @author Graham * @author Graham
*/ */