Class XMPMetadataResource

java.lang.Object
org.apache.tika.server.core.resource.MetadataResource
org.apache.tika.server.standard.resource.XMPMetadataResource
All Implemented Interfaces:
TikaResourceAware, TikaServerResource

public class XMPMetadataResource extends MetadataResource implements TikaResourceAware
XMP is content negotiation on /meta, not a path of its own: this class inherits @Path("/meta") from MetadataResource and differs only in producing application/rdf+xml. CXF picks between the two by the request's Accept header.
  • Constructor Details

    • XMPMetadataResource

      public XMPMetadataResource(TikaResource tikaResource)
    • XMPMetadataResource

      public XMPMetadataResource()
      Required by the service loader, which cannot supply the TikaResource.
  • Method Details

    • setTikaResource

      public void setTikaResource(TikaResource tikaResource)
      Specified by:
      setTikaResource in interface TikaResourceAware
      Overrides:
      setTikaResource in class MetadataResource
    • getMetadataField

      @PUT @Path("{field}") @Produces("application/rdf+xml") public jakarta.ws.rs.core.Response getMetadataField(InputStream is, @Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @Context jakarta.ws.rs.core.UriInfo info, @PathParam("field") String field) throws Exception
      Description copied from class: MetadataResource
      Get a specific metadata field. If the document parses successfully but the specific metadata field was not found, a
      invalid reference
      javax.ws.rs.core.Response.Status#NOT_FOUND
      is returned. Unlike the other /meta endpoints, a bare field value has no envelope to embed a container-level exception in, so that case is thrown (422) instead.

      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.

      Overrides:
      getMetadataField in class MetadataResource
      Parameters:
      is - inputstream
      httpHeaders - httpheaders
      info - info
      field - the tika metadata field name
      Returns:
      one of
      invalid reference
      javax.ws.rs.core.Response.Status#OK
      or
      invalid reference
      javax.ws.rs.core.Response.Status#NOT_FOUND
      Throws:
      Exception
    • getMetadataFromMultipart

      @POST @Consumes("multipart/form-data") @Produces("application/rdf+xml") @Path("form") public jakarta.ws.rs.core.Response getMetadataFromMultipart(org.apache.cxf.jaxrs.ext.multipart.Attachment att, @Context jakarta.ws.rs.core.UriInfo info) throws Exception
      Overrides:
      getMetadataFromMultipart in class MetadataResource
      Throws:
      Exception
    • getMetadata

      @PUT @Produces("application/rdf+xml") public jakarta.ws.rs.core.Response getMetadata(InputStream is, @Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @Context jakarta.ws.rs.core.UriInfo info) throws Exception
      Overrides:
      getMetadata in class MetadataResource
      Throws:
      Exception