예제 #1
0
 public void handle(ChannelHandlerContext ctx, HttpRequest req)
     throws IOException, URISyntaxException {
   String op = params.op();
   HttpMethod method = req.method();
   if (PutOpParam.Op.CREATE.name().equalsIgnoreCase(op) && method == PUT) {
     onCreate(ctx);
   } else if (PostOpParam.Op.APPEND.name().equalsIgnoreCase(op) && method == POST) {
     onAppend(ctx);
   } else if (GetOpParam.Op.OPEN.name().equalsIgnoreCase(op) && method == GET) {
     onOpen(ctx);
   } else if (GetOpParam.Op.GETFILECHECKSUM.name().equalsIgnoreCase(op) && method == GET) {
     onGetFileChecksum(ctx);
   } else {
     throw new IllegalArgumentException("Invalid operation " + op);
   }
 }