|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContentTypeOperations
Content format related operations, such as file extension look-up. 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.
The methods on ContentTypeOperations can be invoked using ContentTypeOperationsInstance
.
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. |
Collection<ContentType> |
listContentTypes() Returns a collection of all content type mappings known to the system. |
Collection<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 |
---|
ContentType getContentTypeFromMimeType(String mimeType) throws UnsupportedContentTypeException, IllegalMimeTypeException
mimeType
- file MIME type. e.g. text/html.UnsupportedContentTypeException
- the MIME type does not correspond to a recognized sealed or sealable document.IllegalMimeTypeException
- the MIME type is syntactically invalid.Collection<ContentType> listContentTypesFromMimeType(String mimeType) throws UnsupportedContentTypeException, IllegalMimeTypeException
mimeType
- file MIME type. e.g. text/html.UnsupportedContentTypeException
- the MIME type does not correspond to a recognized sealed or sealable document.IllegalMimeTypeException
- the MIME type is syntactically invalid.ContentType getContentTypeFromExtension(String extension) throws UnsupportedContentTypeException
extension
- file extension, without leading period.UnsupportedContentTypeException
- the extension does not correspond to a recognized sealed or sealable document.ContentType getContentTypeFromPath(String path) throws UnsupportedContentTypeException
getContentTypeFromExtension
.path
- file path. Only the extension is significant.UnsupportedContentTypeException
- the file does not correspond to a recognized sealed or sealable document.String[] listMimeTypes(boolean sealed, boolean unsealed)
sealed
- if true, sealed MIME types are returned.unsealed
- if true, unsealed MIME types are returned.String[] listExtensions(boolean sealed, boolean unsealed)
sealed
- if true, sealed file extensions are returned.unsealed
- if true, unsealed file extensions are returned.Collection<ContentType> listContentTypes()
import static oracle.irm.engine.content.type.ContentTypeOperationsInstance.listContentTypes; import static oracle.irm.engine.system.i18n.VisualizationInstance.displaySummary; import java.util.Collection; import java.util.Locale; import oracle.irm.engine.content.type.ContentType; public class ListContentTypes { public static void main(String[] args) { Locale locale = Locale.getDefault(); Collection<ContentType> types = listContentTypes(); for (ContentType type : types) { String summary = displaySummary(type, locale); System.out.println(summary); System.out.println(""); } } }
boolean isSealableFile(String path)
path
- file path.boolean isSealedFile(String path)
path
- file path.boolean isSealableMimeType(String mimeType) throws IllegalMimeTypeException
mimeType
- a MIME type.IllegalMimeTypeException
- the MIME type is syntactically invalid.boolean isSealedMimeType(String mimeType) throws IllegalMimeTypeException
mimeType
- a MIME type.IllegalMimeTypeException
- the MIME type is syntactically invalid.String getSealedFileName(String name) throws UnsupportedContentTypeException
name
- the file name.UnsupportedContentTypeException
- the file name does not correspond to a recognized sealed or sealable document.
|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |