|
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 |
java.lang.Object
oracle.irm.engine.content.type.ContentTypeOperationsInstance
public final class ContentTypeOperationsInstance
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.
This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.
import static oracle.irm.engine.content.type.ContentTypeOperationsInstance.*;
Method Summary | |
---|---|
static ContentType |
getContentTypeFromExtension(String extension) Get the content type from a sealed or unsealed file extension. |
static ContentType |
getContentTypeFromMimeType(String mimeType) Get the content type from a MIME type. |
static ContentType |
getContentTypeFromPath(String path) Get the content type from a file path. |
static String |
getSealedFileName(String name) Convert a file name into the corresponding sealed file name. |
static boolean |
isSealableFile(String path) Determines if a file can be sealed, given a path to the file. |
static boolean |
isSealableMimeType(String mimeType) Determine if content for a specified MIME type can be sealed. |
static boolean |
isSealedFile(String path) Determines if a file is sealed, given a path to the file. |
static boolean |
isSealedMimeType(String mimeType) Determine if a specified MIME type describes sealed content. |
static Collection<ContentType> |
listContentTypes() Returns a collection of all content type mappings known to the system. |
static Collection<ContentType> |
listContentTypesFromMimeType(String mimeType) List all the content type mappings corresponding to a given MIME type. |
static String[] |
listExtensions(boolean sealed, boolean unsealed) Returns a collection of recognized file extensions. |
static String[] |
listMimeTypes(boolean sealed, boolean unsealed) Returns a collection of recognized MIME types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static 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.public static 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.public static 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.public static 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.public static String[] listMimeTypes(boolean sealed, boolean unsealed)
sealed
- if true, sealed MIME types are returned.unsealed
- if true, unsealed MIME types are returned.public static String[] listExtensions(boolean sealed, boolean unsealed)
sealed
- if true, sealed file extensions are returned.unsealed
- if true, unsealed file extensions are returned.public static 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(""); } } }
public static boolean isSealableFile(String path)
path
- file path.public static boolean isSealedFile(String path)
path
- file path.public static boolean isSealableMimeType(String mimeType) throws IllegalMimeTypeException
mimeType
- a MIME type.IllegalMimeTypeException
- the MIME type is syntactically invalid.public static boolean isSealedMimeType(String mimeType) throws IllegalMimeTypeException
mimeType
- a MIME type.IllegalMimeTypeException
- the MIME type is syntactically invalid.public static 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 |