@Path(value="/meta") public class MetadataResource extends Object
Constructor and Description |
---|
MetadataResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getMetadata(InputStream is,
javax.ws.rs.core.HttpHeaders httpHeaders,
javax.ws.rs.core.UriInfo info) |
javax.ws.rs.core.Response |
getMetadataField(InputStream is,
javax.ws.rs.core.HttpHeaders httpHeaders,
javax.ws.rs.core.UriInfo info,
String field)
Get a specific metadata field.
|
javax.ws.rs.core.Response |
getMetadataFromMultipart(org.apache.cxf.jaxrs.ext.multipart.Attachment att,
javax.ws.rs.core.UriInfo info) |
protected Metadata |
parseMetadata(InputStream is,
Metadata metadata,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
javax.ws.rs.core.UriInfo info) |
@POST @Consumes(value="multipart/form-data") @Produces(value={"text/csv","application/json"}) @Path(value="form") public javax.ws.rs.core.Response getMetadataFromMultipart(org.apache.cxf.jaxrs.ext.multipart.Attachment att, @Context javax.ws.rs.core.UriInfo info) throws Exception
Exception
@PUT @Produces(value={"text/csv","application/json"}) public javax.ws.rs.core.Response getMetadata(InputStream is, @Context javax.ws.rs.core.HttpHeaders httpHeaders, @Context javax.ws.rs.core.UriInfo info) throws Exception
Exception
@PUT @Path(value="{field}") @Produces(value={"text/csv","application/json","text/plain"}) public javax.ws.rs.core.Response getMetadataField(InputStream is, @Context javax.ws.rs.core.HttpHeaders httpHeaders, @Context javax.ws.rs.core.UriInfo info, @PathParam(value="field") String field) throws Exception
Response.Status.BAD_REQUEST
is generated. If the stream
was successfully parsed but the specific metadata field was not found, then a
Response.Status.NOT_FOUND
is returned.
Note that this method handles multivalue fields and returns possibly more
metadata value than requested.
If you want XMP, you must be careful to specify the exact XMP key.
For example, "Author" will return nothing, but "dc:creator" will return the correct value.is
- inputstreamhttpHeaders
- httpheadersinfo
- infofield
- the tika metadata field nameResponse.Status.OK
,
Response.Status.NOT_FOUND
, or
Response.Status.BAD_REQUEST
Exception
protected Metadata parseMetadata(InputStream is, Metadata metadata, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, javax.ws.rs.core.UriInfo info) throws IOException
IOException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.