|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.publish.TextFileEntry
public class TextFileEntry
Represents a text file entry that can then be added to a result package for publishing. See Constructing a Result Package to Publish for an example of how this class is used.
Field Summary |
---|
Fields inherited from class com.sas.services.publish.AbstractEntry |
---|
BINARY_COMPAT_VERSION, CATALOG_COMPAT_VERSION, DATASET_COMPAT_VERSION, DEFAULT_ENTRY_VERSION, HTML_COMPAT_VERSION, MDDB_COMPAT_VERSION, NESTEDPACKAGE_COMPAT_VERSION, REFERENCE_COMPAT_VERSION, SQLVIEW_COMPAT_VERSION, TEXT_COMPAT_VERSION, VIEWER_COMPAT_VERSION |
Constructor Summary | |
---|---|
|
TextFileEntry()
Creates a default instance. |
protected |
TextFileEntry(java.lang.Class theClass)
Creates a new text file entry exporting a remote object using RMI socket factories appropriate for the specified class. |
|
TextFileEntry(java.io.File file)
Creates a text file entry. |
|
TextFileEntry(java.io.InputStream inputStream,
java.lang.String name)
Creates a text file entry. |
|
TextFileEntry(java.io.Reader reader,
java.lang.String name)
Creates a text file entry. |
Method Summary | |
---|---|
protected void |
closeEntry()
Remove any temporary files needed for inputstream re-use and mark this entry as closed. |
void |
consumeStream()
Consume and close the input stream provided on the constructor. |
protected void |
finalize()
At finalize time, cleanup temporary files if necessary. |
java.lang.String |
getMIMEType()
Returns the MIME type associated with this text file entry. |
java.lang.String |
getName()
Returns the name of the file. |
java.io.Reader |
getReader()
Gets reader for the text file entry. |
java.io.Reader |
getReader(int maxLineLength)
Gets reader for the text file entry. |
java.io.Reader |
getReader(java.lang.Object readerID)
Deprecated. Use getReader() which now supports remote readers.
|
com.sas.io.RemoteReaderInterface |
getRemoteReader(java.lang.Object readerID)
Deprecated. Use getReader() which now supports remote readers.
|
java.lang.Object |
hasReader()
Deprecated. this method no longer needed as getReader() will return a reader that can be used in a remote environment |
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the text file. |
void |
setMIMEType(java.lang.String mimeType)
Sets the MIME associated with this file entry. |
Methods inherited from class com.sas.services.publish.AbstractEntry |
---|
getDescription, getEntityKey, getNameValuePairs, getURL, isClosed, isReadOnly, sameEntity, setClosed, setDescription, setEntityKey, setNameValuePairs, setRead, throwExceptionIfClosed |
Methods inherited from interface com.sas.services.publish.EntryInterface |
---|
getDescription, getNameValuePairs, getURL, isReadOnly, setDescription, setNameValuePairs |
Constructor Detail |
---|
public TextFileEntry() throws java.rmi.RemoteException
java.rmi.RemoteException
- If a network anomaly is encountered.protected TextFileEntry(java.lang.Class theClass) throws java.rmi.RemoteException
theClass
- The class to use when determine which RMI socket factories
are to be used when exporting a remote object.
java.rmi.RemoteException
- If a network anomaly is encountered.public TextFileEntry(java.io.File file) throws java.lang.IllegalArgumentException, java.rmi.RemoteException
file
- The text file.
java.lang.IllegalArgumentException
- If a null
file is
specified.
java.rmi.RemoteException
- If a network anomaly is encountered.public TextFileEntry(java.io.InputStream inputStream, java.lang.String name) throws java.lang.IllegalArgumentException, java.rmi.RemoteException
inputStream
- The input stream of the text file.name
- The name of the text file entry. This name will be used as the
name of the entry when publishing the package.
java.lang.IllegalArgumentException
- If a null
input stream or
a null
name is specified.
java.rmi.RemoteException
- If a network anomaly is encountered.public TextFileEntry(java.io.Reader reader, java.lang.String name) throws java.lang.IllegalArgumentException, java.rmi.RemoteException
reader
- The reader.name
- The name of the text file entry. This name will be used as the
name of the entry when publishing the package.
java.lang.IllegalArgumentException
- If a null
reader or a
null
name is specified.
java.rmi.RemoteException
- If a network anomaly is encountered.Method Detail |
---|
public java.lang.String getMIMEType() throws java.rmi.RemoteException, TransportException, java.lang.IllegalStateException
getMIMEType
in interface TextFileEntryInterface
String
The MIME type associated with this text file
entry; can be null
.
java.lang.IllegalStateException
- if the result package containing this entry
has already been closed.
TransportException
- If the transport encounters an error getting
the MIME type.
java.rmi.RemoteException
- If a network anomaly is encounteredpublic void setMIMEType(java.lang.String mimeType) throws java.lang.IllegalStateException, java.rmi.RemoteException
setMIMEType
in interface TextFileEntryInterface
mimeType
- The MIME type associated with this file entry.
java.lang.IllegalStateException
- If the entry is read only or if the result
package containing this entry has alredy been closed.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.lang.String getName() throws java.rmi.RemoteException, TransportException, java.lang.IllegalStateException
getName
in interface TextFileEntryInterface
String
The name of the file.
java.lang.IllegalStateException
- if the result package containing this entry
has already been closed.
TransportException
- If the transport encounters an error getting
the name of the file.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.io.Reader getReader() throws java.io.IOException, java.rmi.RemoteException, java.lang.IllegalStateException
getReader
in interface TextFileEntryInterface
java.lang.IllegalStateException
- if the result package containing this entry
has already been closed.
java.io.IOException
- If an error occurs constructing the input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.io.Reader getReader(java.lang.Object readerID) throws java.io.IOException, java.rmi.RemoteException, java.rmi.UnmarshalException, java.lang.IllegalStateException
getReader()
which now supports remote readers.
getRemoteReader(java.lang.Object)
in order to obtain the reader.
getReader
in interface com.sas.io.ReaderProviderInterface
getReader
in interface TextFileEntryInterface
readerID
- The reader description should be null
; it
will be ignored.
java.lang.IllegalStateException
- if the result package containing this entry
has already been closed.
java.rmi.UnmarshalException
- If invoked on a remote object.
java.io.IOException
- If an error occurs constructing the input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.public com.sas.io.RemoteReaderInterface getRemoteReader(java.lang.Object readerID) throws com.sas.io.ChainedIOException, java.rmi.RemoteException, java.lang.IllegalStateException
getReader()
which now supports remote readers.
getRemoteReader
in interface com.sas.io.ReaderProviderInterface
getRemoteReader
in interface TextFileEntryInterface
readerID
- The reader description should be null
;it
will be ignored.
RemoteReader
The file as a remote Reader.
java.lang.IllegalStateException
- if the result package containing this entry
has already been closed.
com.sas.io.ChainedIOException
- If an I/O error occurs obtaining the reader.
java.rmi.RemoteException
- If a network anomaly is encountered.public void setEncoding(java.lang.String encoding) throws java.rmi.RemoteException, java.lang.IllegalStateException
setEncoding
in interface TextFileEntryInterface
encoding
- The encoding for this text file.
java.lang.IllegalStateException
- If the entry is read only or if the result
package containing this entry has already been closed.
java.rmi.RemoteException
- If a network anomaly is encounteredpublic java.lang.Object hasReader() throws java.rmi.UnmarshalException, java.rmi.RemoteException, java.lang.IllegalStateException
hasReader
in interface com.sas.io.ReaderProviderInterface
hasReader
in interface TextFileEntryInterface
java.rmi.UnmarshalException
- if invoked on a remote object
java.rmi.RemoteException
- if a network I/O error occurs.
java.lang.IllegalStateException
public void consumeStream() throws java.io.IOException, java.rmi.RemoteException, java.lang.IllegalStateException
java.lang.IllegalStateException
- If the package containing this entry is
already closed.
java.io.IOException
- If an error occurs constructing the input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.protected void closeEntry()
public java.io.Reader getReader(int maxLineLength) throws java.io.IOException, java.rmi.RemoteException, java.lang.IllegalStateException
The maximum line length parameter is only supported by the Requester transport; it will ignored by all other transports.
getReader
in interface TextFileEntryInterface
maxLineLength
- the maximum length of any line that will be in the
file. This parameter is supported by the Requester transport; it
will be ignored by all other delivery transports.
java.io.IOException
- If an error occurs constructing the input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.
java.lang.IllegalStateException
- If the package containing this entry is
already closed.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |