Package org.w3c.jigsaw.http

Examples of org.w3c.jigsaw.http.Client


    protected InputStream getInputStream(Request request)
  throws ProtocolException
    {
  // How fun HTTP/1.1 is, allowing us to double the network traffic :-(
  // If this is a 1.1 request, send a 100 continue:
  Client client = request.getClient();
  if ( client != null ) {
      try {
    client.sendContinue();
      } catch (IOException ex) {
    throw new HTTPException(ex.getMessage());
      }
  }
  // Now, only, get the data:
View Full Code Here


//      }
//  }
  // Write the body back to the file:
  try {
      // We are about to accept the put, notify client before continuing
      Client client = request.getClient();
      if ( client != null  && request.getExpect() != null ) {
    // FIXME we should check for "100-continue" explicitely
    client.sendContinue();
      }
      if ( fresource.newContent(request.getInputStream()) )
    status = HTTP.CREATED;
      else
    status = HTTP.NO_CONTENT;
View Full Code Here

      throw new HTTPException (error) ;
  }
  // Now feed the process:
  try {
      // Send the 100 status code:
      Client client = request.getClient();
      if ( client != null )
    client.sendContinue();
      InputStream in = request.getInputStream();
      if ( in == null ) {
    // There was no input to that CCI, close process stream
    process.getOutputStream().close();
      } else {
View Full Code Here

  }
  ImageFileResource ifresource = (ImageFileResource) fresource;
  // Write the body back to the file:
  try {
      // We are about to accept the put, notify client before continuing
      Client client = request.getClient();
      if ( client != null  && request.getExpect() != null ) {
    client.sendContinue();
      }
      if ( ifresource.newMetadataContent(request.getInputStream()) )
    status = HTTP.CREATED;
      else
    status = HTTP.NO_CONTENT;
View Full Code Here

    {
  // Are we being edited ?
  if ( ! checkRealm() )
      return ;
  // Internal requests always allowed:
  Client client = request.getClient() ;
  if ( client == null )
      return ;
  // Check for User by IP address:
  boolean ipchecked = false ;
  ResourceReference rr_user = lookupUser(client.getInetAddress());
  if (rr_user != null) {
      try {
    AuthUser user = (AuthUser) rr_user.lock();
    if ( user != null ) {
        ipchecked = true ;
View Full Code Here

     *
     * @param request  the request in question
     * @return  the attached ssl session or null if not applicable
     */
    private static final SSLSession getSession(Request request) {
       Client cl = request.getClient();
  if (cl instanceof SSLSocketClient) {
      return ((SSLSocketClient)cl).getSession();
        }
        return null;
    }
View Full Code Here

      try {
    Reader in = getReader() ;
    // Notify the client that we are willing to continue
    String exp = request.getExpect();
    if (exp != null && (exp.equalsIgnoreCase("100-continue"))) {
        Client client = request.getClient();
        if ( client != null ) {
      client.sendContinue();
        }
    }
    String encoding = getCharacterEncoding();
    if (encoding == null) {
        dec = new URLDecoder (in, false, "8859_1");
View Full Code Here

  URLDecoder dec = null;
  if (mustURLDecode) {
      try {
    InputStream in = request.getInputStream() ;
    // Notify the client we are willing to continue processing:
    Client client = request.getClient();
    // FIXME check expect
    if ( client != null ) {
        client.sendContinue();
    }
    dec = new URLDecoder (in, getOverrideFlag()) ;
    dec.parse () ;
      } catch (URLDecoderException e) {
    Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
View Full Code Here

  try {
      InputStream qDataStream = null ;
      if(request.getMethod().equals("POST") &&
         type.match(request.getContentType()) >= 0) {
    // Notify the client that we are willing to continue:
    Client client = request.getClient();
    if ( client != null )
        client.sendContinue();
    qDataStream = request.getInputStream() ;
      } else if(queryString != null) {
    qDataStream = new StringBufferInputStream(queryString) ;
      }
      if(qDataStream != null) {
View Full Code Here

    {
  // Are we being edited ?
  if ( ! checkRealm() )
      return ;
  // Internal requests always allowed:
  Client client = request.getClient() ;
  if ( client == null )
      return ;
  // check for nonce validity
  Date d = new Date();
  if ((d.getTime() - prev_date) / 1000 > nonce_ttl) {
View Full Code Here

TOP

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

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.