|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.io.SerializableDataSource
public class SerializableDataSource
represents a serialisable data source.
| Constructor Summary | |
|---|---|
SerializableDataSource(byte[] byteArray,
java.lang.String n,
java.lang.String c)
creates a new data source from a given byte buffer, the given name and the given content-type. |
|
SerializableDataSource(javax.activation.DataSource s)
creates a new serialisable data source from a given DataSource. |
|
SerializableDataSource(java.io.File f)
creates a new data source from a given file. |
|
SerializableDataSource(java.io.File f,
java.lang.String n)
creates a new data source from a given file with the given name. |
|
SerializableDataSource(java.io.InputStream i,
java.lang.String n)
creates a new data source from a given InputStream and the given
name with a content-type of "application/octet-stream", which will be
buffered until sending time. |
|
SerializableDataSource(java.io.InputStream i,
java.lang.String n,
java.lang.String c)
creates a new data source from a given InputStream, the given
name and the given content-type. |
|
SerializableDataSource(java.lang.String s,
java.lang.String n,
java.lang.String c)
creates a data source from a given string, the given name and the given content-type. |
|
SerializableDataSource(VirtualFile f)
creates a new data source from a given virtual file. |
|
SerializableDataSource(VirtualFile f,
java.lang.String n)
creates a new data source from a given virtual file with the given name. |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
returns the content-type of the data source. |
java.io.InputStream |
getInputStream()
returns an InputStream for the data source. |
long |
getLength()
returns the length of the source. |
java.lang.String |
getName()
returns the name. |
java.io.OutputStream |
getOutputStream()
will always throw an IOException. |
void |
setContentType(java.lang.String type)
sets the content type. |
java.lang.String |
toString()
returns a string representation of the SerializableDataSource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SerializableDataSource(javax.activation.DataSource s)
throws java.io.IOException
DataSource.
s - the source DataSource
java.io.IOException - on errors reading from the DataSource's InputStreampublic SerializableDataSource(java.io.File f)
This constructor assumes that the file will still be at the given
location upon sending time. If you are working with a temporary
file, use
SerializableDataSource(InputStream,String)
instead.
f - the file
public SerializableDataSource(java.io.File f,
java.lang.String n)
This constructor assumes that the file will still be at the given
location upon sending time. If you are working with a temporary
file, use
SerializableDataSource(InputStream, String)
instead.
f - the filen - the namepublic SerializableDataSource(VirtualFile f)
This constructor assumes that the virtual file will still be at
the given location upon sending time. If you are working with a
temporary file, use
SerializableDataSource(InputStream,String)
instead.
f - the file
public SerializableDataSource(VirtualFile f,
java.lang.String n)
This constructor assumes that the virtual file will still be at
the given location upon sending time. If you are working with a
temporary file, use
SerializableDataSource(InputStream,String)
instead.
f - the filen - the name
public SerializableDataSource(java.io.InputStream i,
java.lang.String n)
throws java.io.IOException
InputStream and the given
name with a content-type of "application/octet-stream", which will be
buffered until sending time.
i - the input streamn - the name
java.io.IOException - on errors during buffering
public SerializableDataSource(java.io.InputStream i,
java.lang.String n,
java.lang.String c)
throws java.io.IOException
InputStream, the given
name and the given content-type. The stream will be buffered until
sending time.
i - the input streamn - the namec - the content-type
java.io.IOException - on errors during buffering
public SerializableDataSource(byte[] byteArray,
java.lang.String n,
java.lang.String c)
byteArray - the buffern - the namec - the content-type
public SerializableDataSource(java.lang.String s,
java.lang.String n,
java.lang.String c)
s - the text content as a stringn - the namec - the content type| Method Detail |
|---|
public final java.lang.String getContentType()
getContentType in interface javax.activation.DataSourceDataSource.getContentType()public final void setContentType(java.lang.String type)
type - the content type to set
public final java.io.InputStream getInputStream()
throws java.io.IOException
InputStream for the data source.
getInputStream in interface javax.activation.DataSourcejava.io.IOException - on errors accessing the InputStreamDataSource.getInputStream()public final java.lang.String getName()
getName in interface javax.activation.DataSourcegetName in interface INamedDataSource.getName()
public final java.io.OutputStream getOutputStream()
throws java.io.IOException
IOException.
getOutputStream in interface javax.activation.DataSourcejava.io.IOException - alwaysDataSource.getOutputStream()public final long getLength()
public java.lang.String toString()
SerializableDataSource.
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||