Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.j2ee.jws.content.type
Interface ContentTypeOperationsEndpoint


public interface ContentTypeOperationsEndpoint

Web Service end point interface for Content Type Operations. This interface provides utility methods for getting ContentType information from file extensions and MIME types. These methods are useful when sealing and unsealing content and MIME type or file extension information is required.

WSDL

The WSDL for this end point interface can be downloaded from the server using the following URL:

 http://irm.example.com/irm_sealing/content_type_operations?wsdl
 

Endpoint URL

Requests for this web service should be sent to the following URL:

 https://irm.example.com/irm_sealing/content_type_operations
 

Method Summary
 ContentType getContentTypeFromExtension(String extension)
          Get the content type from a sealed or unsealed file extension.
 ContentType getContentTypeFromMimeType(String mimeType)
          Get the content type from a MIME type.
 ContentType getContentTypeFromPath(String path)
          Get the content type from a file path.
 String getSealedFileName(String name)
          Convert a file name into the corresponding sealed file name.
 boolean isSealableFile(String path)
          Determines if a file can be sealed, given a path to the file.
 boolean isSealableMimeType(String mimeType)
          Determine if content for a specified MIME type can be sealed.
 boolean isSealedFile(String path)
          Determines if a file is sealed, given a path to the file.
 boolean isSealedMimeType(String mimeType)
          Determine if a specified MIME type describes sealed content.
 ContentType[] listContentTypes()
          Returns a collection of all content type mappings known to the system.
 ContentType[] listContentTypesFromMimeType(String mimeType)
          List all the content type mappings corresponding to a given MIME type.
 String[] listExtensions(boolean sealed, boolean unsealed)
          Returns a collection of recognized file extensions.
 String[] listMimeTypes(boolean sealed, boolean unsealed)
          Returns a collection of recognized MIME types.

 

Method Detail

getContentTypeFromMimeType

ContentType getContentTypeFromMimeType(String mimeType)
                                       throws UnsupportedContentTypeFault,
                                              IllegalMimeTypeFault
Get the content type from a MIME type. If a non sealed MIME type is specified and there are multiple sealed content types the first content type is returned. e.g. the {text/plain} content type can be sealed as sealed text or sealed email. In this case the sealed text content type will be returned.
Parameters:
mimeType - file MIME type. e.g. text/html.
Returns:
the content type.
Throws:
UnsupportedContentTypeFault - the MIME type does not correspond to a recognized sealed or sealable document.
IllegalMimeTypeFault - the MIME type is syntactically invalid.

listContentTypesFromMimeType

ContentType[] listContentTypesFromMimeType(String mimeType)
                                           throws UnsupportedContentTypeFault,
                                                  IllegalMimeTypeFault
List all the content type mappings corresponding to a given MIME type. A MIME type may correspond to more than one mapping. This generally happens with sealed MIME types, which can match multiple unsealed MIME types or extensions. For instance, application/vnd.sealedmedia.softseal.html can match both htm and html file extensions.
Parameters:
mimeType - file MIME type. e.g. text/html.
Returns:
the list of content types.
Throws:
UnsupportedContentTypeFault - the MIME type does not correspond to a recognized sealed or sealable document.
IllegalMimeTypeFault - the MIME type is syntactically invalid.

getContentTypeFromExtension

ContentType getContentTypeFromExtension(String extension)
                                        throws UnsupportedContentTypeFault
Get the content type from a sealed or unsealed file extension. For an unsealed file extensions there is usually only one target sealed content type. e.g. pass html and get the sealed HTML content type information. For content types that share the same unsealed file extension (e.g. sealed text and sealed email both have an unsealed file extension of txt) the most commonly used sealed type is returned. In the example this would be sealed text. As using the unsealed file extension can cause ambiguity it is advisable to use the sealed file extension with this method.
Parameters:
extension - file extension, without leading period.
Returns:
the content type.
Throws:
UnsupportedContentTypeFault - the extension does not correspond to a recognized sealed or sealable document.

getContentTypeFromPath

ContentType getContentTypeFromPath(String path)
                                   throws UnsupportedContentTypeFault
Get the content type from a file path. This function merely extracts the file extension and calls getContentTypeFromExtension.
Parameters:
path - file path. Only the extension is significant.
Returns:
the content type.
Throws:
UnsupportedContentTypeFault - the file does not correspond to a recognized sealed or sealable document.

listMimeTypes

String[] listMimeTypes(boolean sealed,
                       boolean unsealed)
Returns a collection of recognized MIME types.
Parameters:
sealed - if true, sealed MIME types are returned.
unsealed - if true, unsealed MIME types are returned.
Returns:
the list of MIME types.

listExtensions

String[] listExtensions(boolean sealed,
                        boolean unsealed)
Returns a collection of recognized file extensions.
Parameters:
sealed - if true, sealed file extensions are returned.
unsealed - if true, unsealed file extensions are returned.
Returns:
the list of file extensions.

listContentTypes

ContentType[] listContentTypes()
Returns a collection of all content type mappings known to the system.
Returns:
the supported content types.

isSealableFile

boolean isSealableFile(String path)
Determines if a file can be sealed, given a path to the file. The file is not inspected - the decision is made on the basis of the file extension alone.
Parameters:
path - file path.
Returns:
true if the file can be sealed.

isSealedFile

boolean isSealedFile(String path)
Determines if a file is sealed, given a path to the file. The file is not inspected - the decision is made on the basis of the file extension alone.
Parameters:
path - file path.
Returns:
true if the file is sealed.

isSealableMimeType

boolean isSealableMimeType(String mimeType)
                           throws IllegalMimeTypeFault
Determine if content for a specified MIME type can be sealed.
Parameters:
mimeType - a MIME type.
Returns:
true if the MIME type describes a file that can be sealed.
Throws:
IllegalMimeTypeFault - the MIME type is syntactically invalid.

isSealedMimeType

boolean isSealedMimeType(String mimeType)
                         throws IllegalMimeTypeFault
Determine if a specified MIME type describes sealed content.
Parameters:
mimeType - a MIME type.
Returns:
true if the MIME type describes a sealed file.
Throws:
IllegalMimeTypeFault - the MIME type is syntactically invalid.

getSealedFileName

String getSealedFileName(String name)
                         throws UnsupportedContentTypeFault
Convert a file name into the corresponding sealed file name. When content is sealed, the file extension is typically altered. e.g. .doc becomes .sdoc. This method converts the provided file name (or file and path) into the equivalent sealed file name. If the file is already sealed no change is made to the file name.
Parameters:
name - the file name.
Returns:
the sealed file name.
Throws:
UnsupportedContentTypeFault - the file name does not correspond to a recognized sealed or sealable document.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.