protected RequestParameters getWriteParams() { if (metadataExtraction == null || metadataExtraction == MetadataExtraction.NONE) return null; RequestParameters params = new RequestParameters(); if (metadataExtraction == MetadataExtraction.PROPERTIES) params.put("extract", "properties"); else if (metadataExtraction == MetadataExtraction.DOCUMENT) params.put("extract", "document"); else throw new MarkLogicInternalException( "Internal error - unknown metadata extraction policy: " + metadataExtraction.name()); return params; }
@Override public <T extends BinaryReadHandle> T read( DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform, long start, long length, Transaction transaction) { if (logger.isInfoEnabled()) logger.info("Reading range of binary content for {}", desc.getUri()); RequestParameters extraParams = new RequestParameters(); if (length > 0) extraParams.put("range", "bytes=" + start + "-" + (start + length - 1)); else extraParams.put("range", "bytes=" + String.valueOf(start)); return read(desc, metadataHandle, contentHandle, transform, transaction, null, extraParams); }