Package org.w3c.jigsaw.http

Examples of org.w3c.jigsaw.http.HTTPException


    d.parse () ;
      } catch (URLDecoderException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent("Invalid request: "+
         "unable to decode form data.");
    throw new HTTPException (error) ;
      } catch (IOException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent("Invalid request: unable to read form data.");
    throw new HTTPException (error) ;
      }
      return d.getValue("editlog") ;
  }
View Full Code Here


      throws ProtocolException
  {
      if ( ! request.hasState("query") ) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
    error.setContent("Invalid query field.");
    throw new HTTPException (error) ;
      }
      String cmd = request.getQueryString() ;
      if ( cmd.equalsIgnoreCase("log") ) {
    return dolog(request) ;
      } else if ( cmd.equalsIgnoreCase ("diff")) {
    return dodiff(request) ;
      } else {
    String rev = getRevisionToEdit(request);
    if (rev != null)
        return doEditRev(request, rev);
    else {
        Reply error =
      request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
        error.setContent ("Unknown command: "+cmd) ;
        throw new HTTPException(error) ;
    }
      }
  }
View Full Code Here

      String comment  = data.getValue("comment");
     
      if (revision == null) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    error.setContent("No revision selected !");
    throw new HTTPException (error) ;
      } else if (comment == null) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent("Empty comment not allowed.");
    throw new HTTPException (error) ;
      }
      try {
    String command[] = new String[2];
    command[0] = "-m"+revision+":\""+comment+"\"";
    command[1] = name;
    getCvsManager().admin(command);
      } catch (CvsException ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g =
        getHtmlGenerator("CVS admin command failed") ;
    g.append ("<p>The CVS <strong>admin</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + ex.getMessage() + "</em>");
    error.setStream (g) ;
    throw new HTTPException (error) ;
      } catch (InvalidResourceException inv_ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
    error.setContent("CvsFrame invalid");
    return error;
      }
View Full Code Here

    " is locked. Try again later.";
      Reply error = error( request,
         HTTP.FORBIDDEN,
         "Error",
         msg );
      throw new HTTPException(error);
  }
  //well done
  return request.makeReply(HTTP.NO_CONTENT) ;
    }
View Full Code Here

        ? "("+u+") changed through Jigsaw, no comments"
        : "changed through Jigsaw, no comments");
    }
    cvs.commitRegexp(regexp, jcomment, env);
      } else {
    throw new HTTPException (badAction(request, action)) ;
      }
  } catch (CvsException ex) {
      String msg = action+" in "+cvs.getDirectory()+" failed";
      throw new HTTPException(CvsFrame.error(request, msg, ex));
  }
    }
View Full Code Here

    cvs.commit(names, jcomment, env);
      } else if ( action.equals ("addcom") ) {
    cvs.add(names, env) ;
    cvs.commit(names, jcomment, env);
      } else {
    throw new HTTPException (badAction(request, action)) ;
      }
  } catch (CvsException ex) {
      String msg = action+" in "+cvs.getDirectory()+" failed";
      throw new HTTPException(CvsFrame.error(request, msg, ex));
  }
    }
View Full Code Here

      return null;
  if ( command == null ) {
      Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
      error.setContent("The process filter of this resource is not "
           + " configured properly (it has no command).");
      throw new HTTPException(error);
  }
  // Okay, run the reply stream through the process:
  try {
      process = runtime.exec (command) ;
  } catch (IOException e) {
      Reply error = request.makeReply(HTTP.NOT_FOUND) ;
      error.setContent("The filter's process command "+
           command[0]+
           " wasn't found: "+e.getMessage()) ;
      throw new HTTPException (error);
  }
  if ( reply.hasContentLength() ) {
      feeder = new ProcessFeeder (process
          , in
          , reply.getContentLength()) ;
View Full Code Here

        l.dump (sb, format) ;
    }
      } catch (MalformedURLException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent ("You are requesting an invalid URL,") ;
    throw new HTTPException (error) ;
      }
  }
  sb.append (")") ;
  return makePICSReply (request, sb) ;
    }
View Full Code Here

        l.dump (sb, format) ;
    }
      } catch (MalformedURLException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent ("You are requesting an invalid URL.") ;
    throw new HTTPException (error) ;
      }
  }
  sb.append (")") ;
  return makePICSReply (request, sb) ;
    }
View Full Code Here

        sb.append (")") ;
    }
      } catch (MalformedURLException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
    error.setContent ("You are requesting an invalid URL.") ;
    throw new HTTPException (error) ;
      }
  }
  sb.append (")") ;
  return makePICSReply (request, sb) ;
    }
View Full Code Here

TOP

Related Classes of org.w3c.jigsaw.http.HTTPException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.