Skip navigation links

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

E12907-02


oracle.irm.engine.content.source
Interface Source

All Known Subinterfaces:
BufferSource, FileSource, ResourceSource, StreamSource, URLSource

public interface Source

A source of content for the sealing process. When content is sealed the sealing algorithms need to know the format/type of the content and, if possible, the size of the content. A source provides these details. Various forms of source are available depending on how the content is to be provided to the sealing algorithms. For example, if a file is to be sealed a FileSource can be used.

Collections

Collections for Source objects can be created using the following factory method. This method creates the most appropriate collection implementation class for storing Source elements.

 Collection<Source> object = createSources();

XML Serialization

Source instances can be serialized as an XML document. This XML document can also be used to recreate a Source object. The following XML document shows an example Source in XML form.

<?xml version="1.0" encoding="UTF-8"?>
<content:BufferSource xmlns:content="http://xmlns.oracle.com/irm/content">
    <buffer>VW5pdCBUZXN0aW5n</buffer>
    <mimeType>text/plain</mimeType>
</content:BufferSource>

See Also:
SealingOperations

Method Summary
 void close()
          Close the source's input stream.
 ContentType getContentType()
          The content format/type information.
 InputStream getInputStream()
          An input stream to the content source.
 long getSize()
          The file size if known.

 

Method Detail

getInputStream

InputStream getInputStream()
An input stream to the content source.

Transient

This property is transient and will not be serialized (e.g into XML, remote method calls).
Returns:
the value of the property. This method will never return null.

getSize

long getSize()
The file size if known. When content is sealed the unsealed content size is written into the sealed content (if it is available at the time of sealing). For content types that can be resealed (editable sealed formats) this size helps the sealing algorithms work more efficiently with sealed content.

If the file size is unknown this property will have a value of -1.

Transient

This property is transient and will not be serialized (e.g into XML, remote method calls).
Returns:
the value of the property.

getContentType

ContentType getContentType()
The content format/type information. When content is sealed the sealed MIME type is embedded into the sealed content. The allows consumers of the sealed content (e.g. the desktop) to understand what native application is required to open the sealed content. This is especially useful if the content is not in file form (with a sealed file extension) and the only way to determine the format is by examining the sealed MIME type.

Transient

This property is transient and will not be serialized (e.g into XML, remote method calls).
Returns:
the value of the property. This method will never return null.

close

void close()
           throws IOException
Close the source's input stream. Closes the input stream and releases any system resources associated with the source. The source will only close the stream if the source created the stream. If a source was provided with an input stream then it will not close that source.
Throws:
IOException - if there is an input/output error closing the stream.

Skip navigation links

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

E12907-02


Copyright © 2010, Oracle. All rights reserved.