static public String contentAsString(AbstractWriteHandle handle) { try { Object content = sendContent(handle); if ( content == null ) return null; String stringContent = null;
private RequestBody makeRequestBody(AbstractWriteHandle document) { if (document == null) { return new EmptyRequestBody(); } HandleImplementation handleBase = HandleAccessor.as(document); Format format = handleBase.getFormat(); String mimetype = (format == Format.BINARY) ? "application/x-unknown-content-type" : handleBase.getMimetype(); MediaType mediaType = MediaType.parse(mimetype); return (document instanceof OutputStreamSender) ? new StreamingOutputImpl((OutputStreamSender) document, null, mediaType) : new ObjectRequestBody(HandleAccessor.sendContent(document), mediaType); }