mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Rename buf -> buffer, fixed documentation.
This commit is contained in:
@@ -39,10 +39,10 @@ public final class JagGrabRequestWorker extends RequestWorker<JagGrabRequest, Re
|
||||
|
||||
@Override
|
||||
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()) {
|
||||
ByteBuf wrapped = Unpooled.wrappedBuffer(buf.get());
|
||||
if (buffer.isPresent()) {
|
||||
ByteBuf wrapped = Unpooled.wrappedBuffer(buffer.get());
|
||||
channel.writeAndFlush(new JagGrabResponse(wrapped)).addListener(ChannelFutureListener.CLOSE);
|
||||
} else {
|
||||
channel.close();
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface ResourceProvider {
|
||||
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.
|
||||
* @return A {@code ByteBuffer} representation of a resource if it exists otherwise {@link Optional#empty()} is
|
||||
|
||||
Reference in New Issue
Block a user