Permalink
Browse files

Rename HTTP upload example classes for disambiguation

  • Loading branch information...
1 parent b7cfc6b commit 4cff6b56ffc09390c104d572bb7b4590b574f5a4 @trustin trustin committed Jan 14, 2012
@@ -44,12 +44,12 @@
/**
*/
-public class HttpClient {
+public class HttpUploadClient {
public static void main(String[] args) {
if (args.length != 2) {
System.err.println(
- "Usage: " + HttpClient.class.getSimpleName() +
+ "Usage: " + HttpUploadClient.class.getSimpleName() +
" baseURI Filepath");
return;
}
@@ -110,7 +110,7 @@ public static void main(String[] args) {
Executors.newCachedThreadPool()));
// Set up the event pipeline factory.
- bootstrap.setPipelineFactory(new HttpClientPipelineFactory(ssl));
+ bootstrap.setPipelineFactory(new HttpUploadClientPipelineFactory(ssl));
// setup the factory: here using a mixed memory/disk based on size threshold
HttpDataFactory factory = new DefaultHttpDataFactory(
@@ -24,7 +24,7 @@
import io.netty.handler.codec.http.HttpResponse;
import io.netty.util.CharsetUtil;
-public class HttpResponseHandler extends SimpleChannelUpstreamHandler {
+public class HttpUploadClientHandler extends SimpleChannelUpstreamHandler {
private volatile boolean readingChunks;
@@ -27,10 +27,10 @@
import io.netty.handler.ssl.SslHandler;
import io.netty.handler.stream.ChunkedWriteHandler;
-public class HttpClientPipelineFactory implements ChannelPipelineFactory {
+public class HttpUploadClientPipelineFactory implements ChannelPipelineFactory {
private final boolean ssl;
- public HttpClientPipelineFactory(boolean ssl) {
+ public HttpUploadClientPipelineFactory(boolean ssl) {
this.ssl = ssl;
}
@@ -56,7 +56,7 @@ public ChannelPipeline getPipeline() throws Exception {
// to be used since huge file transfer
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
- pipeline.addLast("handler", new HttpResponseHandler());
+ pipeline.addLast("handler", new HttpUploadClientHandler());
return pipeline;
}
}
@@ -23,7 +23,7 @@
/**
*/
-public class HttpServer {
+public class HttpUploadServer {
public static void main(String[] args) {
// Configure the server.
ServerBootstrap bootstrap = new ServerBootstrap(
@@ -32,7 +32,7 @@ public static void main(String[] args) {
Executors.newCachedThreadPool()));
// Set up the event pipeline factory.
- bootstrap.setPipelineFactory(new HttpServerPipelineFactory());
+ bootstrap.setPipelineFactory(new HttpUploadServerPipelineFactory());
// Bind and start to accept incoming connections.
bootstrap.bind(new InetSocketAddress(8080));
@@ -60,7 +60,7 @@
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.util.CharsetUtil;
-public class HttpRequestHandler extends SimpleChannelUpstreamHandler {
+public class HttpUploadServerHandler extends SimpleChannelUpstreamHandler {
private volatile HttpRequest request;
@@ -23,7 +23,7 @@
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;
-public class HttpServerPipelineFactory implements ChannelPipelineFactory {
+public class HttpUploadServerPipelineFactory implements ChannelPipelineFactory {
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
@@ -41,7 +41,7 @@ public ChannelPipeline getPipeline() throws Exception {
// Remove the following line if you don't want automatic content compression.
pipeline.addLast("deflater", new HttpContentCompressor());
- pipeline.addLast("handler", new HttpRequestHandler());
+ pipeline.addLast("handler", new HttpUploadServerHandler());
return pipeline;
}
}

0 comments on commit 4cff6b5

Please sign in to comment.