|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.client.DataStream
public abstract class DataStream
Title: DataStream.java
Description:
The model of a datastream as it exists inside the editor.
This class has getters and setters for the fields and bytes of a datastream while it is being edited.
| Field Summary | |
|---|---|
static int |
BASIS
Identifier for BASIS datastreams |
static java.io.ByteArrayInputStream |
EMPTY
Empty stream |
static int |
INLINE
Identifier for INLINE datastreams |
protected boolean |
m_dirty
Whether this datastream is dirty |
| Constructor Summary | |
|---|---|
DataStream(java.io.File tempDir,
java.lang.String id)
Constructs a datastream with a given temporary directory to write itself to, and an identifier. |
|
| Method Summary | |
|---|---|
void |
clearData()
|
java.io.InputStream |
getData()
Gets an InputStream to the local copy of the datastream. |
java.lang.String |
getId()
Gets the id of the datastream inside the object. |
java.lang.String |
getMimeType()
Gets the mime type. |
long |
getSize()
Gets the size, in bytes. |
abstract int |
getType()
Returns INLINE or BASIS. |
boolean |
isDirty()
|
void |
setClean()
|
void |
setData(java.io.InputStream in)
Reads the bytes from the given InputStream as the data
for this digital object. |
void |
setMimeType(java.lang.String mimeType)
Sets the mime type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.io.ByteArrayInputStream EMPTY
public static final int INLINE
public static final int BASIS
protected boolean m_dirty
| Constructor Detail |
|---|
public DataStream(java.io.File tempDir,
java.lang.String id)
| Method Detail |
|---|
public abstract int getType()
public java.lang.String getId()
public java.lang.String getMimeType()
public void setMimeType(java.lang.String mimeType)
public long getSize()
public java.io.InputStream getData()
throws java.io.IOException
InputStream to the local copy of the datastream.
java.io.IOException
public void setData(java.io.InputStream in)
throws java.io.IOException
InputStream as the data
for this digital object. When finished, the InputStream
is closed.
java.io.IOExceptionpublic boolean isDirty()
public void setClean()
public void clearData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||