Package com.cedarsoft.couchdb

Examples of com.cedarsoft.couchdb.ActionResponse


      throw new IllegalStateException( "Invalid media type: " + response.getType() );
    }

    UniqueId uniqueId = deserialize( response.getEntityInputStream() );

    return new ActionResponse( uniqueId, response.getStatus(), response.getLocation() );
  }
View Full Code Here


    try {
      //Wrap the input stream
      try ( MaxLengthByteArrayOutputStream teedOut = new MaxLengthByteArrayOutputStream(); TeeInputStream teeInputStream = new TeeInputStream( entityInputStream, teedOut ) ) {
        UniqueId uniqueId = deserialize( teeInputStream );

        return new ActionResponse( uniqueId, response.getStatus(), response.getLocation(), teedOut.toByteArray() );
      }
    } catch ( IOException e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

      throw new IllegalStateException( "Invalid media type: " + response.getType() );
    }

    UniqueId uniqueId = deserialize( response.getEntityInputStream() );

    return new ActionResponse( uniqueId, response.getStatus(), response.getLocation() );
  }
View Full Code Here

      JsonFactory jsonFactory = JacksonSupport.getJsonFactory();

      JsonParser parser = jsonFactory.createJsonParser( in );
      AbstractJacksonSerializer.nextToken( parser, JsonToken.START_OBJECT );

      ActionResponse deserialized = deserialize( status, parser );

      AbstractJacksonSerializer.ensureParserClosedObject( parser );

      return deserialized;
    } catch ( IOException e ) {
View Full Code Here

    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_ID );
    String id = deserializeFrom.getText();
    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_REV );
    String rev = deserializeFrom.getText();
    AbstractJacksonSerializer.closeObject( deserializeFrom );
    return new ActionResponse( new DocId( id ), new Revision( rev ), status );

    //    AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.FIELD_NAME );
    //    if ( deserializeFrom.getCurrentName().equals( PROPERTY_OK ) ) {
    //    } else {
    //      AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.VALUE_STRING );
View Full Code Here

TOP

Related Classes of com.cedarsoft.couchdb.ActionResponse

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.