Rename buf -> buffer, fixed documentation.

This commit is contained in:
Ryley Kimmel
2015-02-27 16:39:41 -05:00
parent da967209c0
commit 3c6ff3b370
2 changed files with 4 additions and 4 deletions
@@ -39,10 +39,10 @@ public final class JagGrabRequestWorker extends RequestWorker<JagGrabRequest, Re
@Override @Override
protected void service(ResourceProvider provider, Channel channel, JagGrabRequest request) throws IOException { protected void service(ResourceProvider provider, Channel channel, JagGrabRequest request) throws IOException {
Optional<ByteBuffer> buf = provider.get(request.getFilePath()); Optional<ByteBuffer> buffer = provider.get(request.getFilePath());
if (buf.isPresent()) { if (buffer.isPresent()) {
ByteBuf wrapped = Unpooled.wrappedBuffer(buf.get()); ByteBuf wrapped = Unpooled.wrappedBuffer(buffer.get());
channel.writeAndFlush(new JagGrabResponse(wrapped)).addListener(ChannelFutureListener.CLOSE); channel.writeAndFlush(new JagGrabResponse(wrapped)).addListener(ChannelFutureListener.CLOSE);
} else { } else {
channel.close(); channel.close();
@@ -21,7 +21,7 @@ public interface ResourceProvider {
public boolean accept(String path) throws IOException; public boolean accept(String path) throws IOException;
/** /**
* Returns a resource as a {@link ByteBuffer} if it exists. * The resource data, as a {@link ByteBuffer}, wrapped in an {@link Optional}.
* *
* @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 otherwise {@link Optional#empty()} is * @return A {@code ByteBuffer} representation of a resource if it exists otherwise {@link Optional#empty()} is