|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.publish.HTMLFile
public class HTMLFile
The HTMLFileInterface provides a mechanism for setting and getting the attributes of a file contained within an HTML entry.
Files that implement HTMLFileInterface can be inserted into an HTML entry.
HTMLEntryInterface
is a container for various files that implement
HTMLFileInterface. Within MVA SAS, the ODS HTML statement generates HTML
files. The body file contains the results from the procedure. The contents
file is a table of contents that links to the body file. The pages file is a
table of pages that links to the body file. The frame file is a frame that
displays the table of contents, the table of pages and the body file. The
HTML entry provides a way to identify each of these files, and encapsulate
them into one entry.
The HTML file is limited to just one role. One file should be designated as
the main file for the HTML entry. The main file identifies which file in the
HTML entry should be used as the starting point when browsing the HTML entry.
The main file will have a role of HTMLFileInterface.MAIN_BODY_FILE
or
HTMLFileInterface.MAIN_FRAME_FILE
. If a frame file exists, it should be designated as
the main file; otherwise, the body file should be designated as the main
file. All other files are considered companion files. The companion files are
any files other than the main HTML file. The companion files can include,
body, frame, contents and page files, as well as any miscellaneous files
(such as HTML, GIF, JPG) needed by the HTML entry. Supported companion roles
include HTMLFileInterface.FRAME_COMPANION
,HTMLFileInterface.BODY_COMPANION
,
HTMLFileInterface.PAGE_COMPANION
,HTMLFileInterface.CONTENTS_COMPANION
,
HTMLFileInterface.MISC_COMPANION
.
HTMLEntry
,
Serialized FormField Summary |
---|
Fields inherited from interface com.sas.services.publish.HTMLFileInterface |
---|
BODY_COMPANION, CONTENTS_COMPANION, FRAME_COMPANION, MAIN_BODY_FILE, MAIN_FRAME_FILE, MISC_COMPANION, PAGE_COMPANION |
Constructor Summary | |
---|---|
|
HTMLFile()
Constructs a default instance. |
protected |
HTMLFile(java.lang.Class theClass)
Constructs an instance using RMI socket factories appropriate for the specified class. |
|
HTMLFile(java.io.File file,
int role)
Creates an HTML file or companion file. |
|
HTMLFile(java.io.InputStream inputStream,
java.lang.String name,
int role)
Creates an HTML file or companion file. |
Method Summary | |
---|---|
protected void |
closeEntry()
Remove any temporary files needed for inputstream re-use. |
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 |
getEncoding()
Returns the encoding for this file. |
java.lang.String |
getEntityKey()
Get the unique identifier of this result package or entry. |
java.io.InputStream |
getInputStream()
Gets the input stream for this file. |
java.io.InputStream |
getInputStream(java.lang.Object streamID)
Deprecated. Use getInputStream() which now supports remote
input streams. |
java.lang.String |
getMIMEType()
Returns the MIME type of the file. |
java.lang.String |
getName()
Returns the name of the file. |
com.sas.io.RemoteInputStreamInterface |
getRemoteInputStream(java.lang.Object streamID)
Deprecated. Use getInputStream() which now supports remote
input streams. |
int |
getRole()
Returns the role of this file within the HTML entry. |
java.lang.String |
getURL()
Returns the URL for this file. |
java.lang.Object |
hasInputStream()
Deprecated. this method no longer needed as getInputStream() will return an input stream that can be used in a remote environment |
boolean |
isReadOnly()
Returns true when the entry is read only. |
boolean |
sameEntity(com.sas.entities.EntityKeyInterface entity)
|
void |
setEncoding(java.lang.String encoding)
Sets the file encoding. |
void |
setEntityKey(java.lang.String entityKey)
Set the unique entity key. |
void |
setMIMEType(java.lang.String mimeType)
Sets the MIME type associated with this file; can be null. |
void |
setURL(java.lang.String url)
Sets the URL of the file. |
Constructor Detail |
---|
public HTMLFile() throws java.rmi.RemoteException
HTMLFile(File file, int role)
instead of this constructor.
java.rmi.RemoteException
- If a network anomaly is encountered.protected HTMLFile(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 unable to export the remote object.public HTMLFile(java.io.File file, int role) throws java.lang.IllegalArgumentException, java.rmi.RemoteException
There is no default MIME type. To set the MIME type for the entry, use
setMIMEType(String)
.
file
- The file.role
- The role of the file. Valid roles include
HTMLFileInterface.MAIN_BODY_FILE
,HTMLFileInterface.MAIN_FRAME_FILE
,
HTMLFileInterface.BODY_COMPANION
,HTMLFileInterface.FRAME_COMPANION
,
HTMLFileInterface.CONTENTS_COMPANION
,HTMLFileInterface.PAGE_COMPANION
or
HTMLFileInterface.MISC_COMPANION
.
java.lang.IllegalArgumentException
- If a null
file or invalid
file type is specified.
java.rmi.RemoteException
- If a network anomaly is encountered.public HTMLFile(java.io.InputStream inputStream, java.lang.String name, int role) throws java.lang.IllegalArgumentException, java.rmi.RemoteException
There is no default MIME type. To set the MIME type for the entry, use
setMIMEType(String)
.
inputStream
- The input stream of the HTML or companion file.name
- The name of the HTML or companion file. When an HTML file is
published, the URL is used to publish the file, if it was
specified. If the URL is not specified, this name will be used
as the name of the file.role
- The role of the file. Valid roles include
HTMLFileInterface.MAIN_BODY_FILE
,HTMLFileInterface.MAIN_FRAME_FILE
,
HTMLFileInterface.BODY_COMPANION
,HTMLFileInterface.FRAME_COMPANION
,
HTMLFileInterface.CONTENTS_COMPANION
,HTMLFileInterface.PAGE_COMPANION
or
HTMLFileInterface.MISC_COMPANION
.
java.lang.IllegalArgumentException
- If a null
input stream, a
null
name, or an invalid file type is specified.
java.rmi.RemoteException
- If a network anomaly is encountered.Method Detail |
---|
public java.lang.String getURL() throws java.rmi.RemoteException
getURL
in interface HTMLFileInterface
String
The URL for the file.
java.rmi.RemoteException
- If a network anomaly is encountered.public void setURL(java.lang.String url) throws java.lang.IllegalStateException, java.rmi.RemoteException
setURL
in interface HTMLFileInterface
url
- The URL for the file.
java.lang.IllegalStateException
- If the entry is read only.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.lang.String getEncoding() throws java.rmi.RemoteException
getEncoding
in interface HTMLFileInterface
String
The encoding for this file.
java.rmi.RemoteException
- If a network anomaly is encountered.public void setEncoding(java.lang.String encoding) throws java.lang.IllegalStateException, java.rmi.RemoteException
setEncoding
in interface HTMLFileInterface
encoding
- The encoding of the file.
java.lang.IllegalStateException
- If the entry is read only.
java.rmi.RemoteException
- If a network anomaly is encountered.public boolean isReadOnly() throws java.rmi.RemoteException
boolean
True if read only; otherwise if
this is a new entry/package under construction, false
is returned.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.lang.String getName() throws java.rmi.RemoteException
getName
in interface HTMLFileInterface
String
The name of the file.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.lang.String getMIMEType()
getMIMEType
in interface HTMLFileInterface
String
The MIME type of the file.public void setMIMEType(java.lang.String mimeType) throws java.lang.IllegalStateException, java.rmi.RemoteException
setMIMEType
in interface HTMLFileInterface
mimeType
- The MIME type associated with this file.
java.lang.IllegalStateException
- If the entry is read only.
java.rmi.RemoteException
- If a network anomaly is encountered.public int getRole() throws java.rmi.RemoteException
getRole
in interface HTMLFileInterface
int
The role of the file. Supported types include
BODY_COMPANION
,
FRAME_COMPANION
,
CONTENTS_COMPANION
,
PAGE_COMPANION
and
MISC_COMPANION
.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.io.InputStream getInputStream() throws java.io.IOException, java.rmi.RemoteException
getInputStream
in interface HTMLFileInterface
java.io.IOException
- If an error occurs constructing the input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.io.InputStream getInputStream(java.lang.Object streamID) throws java.io.IOException, java.rmi.RemoteException, java.rmi.UnmarshalException
getInputStream()
which now supports remote
input streams.
getRemoteInputStream(Object)
in order to obtain the input stream.
getInputStream
in interface com.sas.io.InputStreamProviderInterface
getInputStream
in interface HTMLFileInterface
streamID
- The stream description should be null
; it
will be ignored.
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.RemoteInputStreamInterface getRemoteInputStream(java.lang.Object streamID) throws com.sas.io.ChainedIOException, java.rmi.RemoteException
getInputStream()
which now supports remote
input streams.
getRemoteInputStream
in interface com.sas.io.InputStreamProviderInterface
getRemoteInputStream
in interface HTMLFileInterface
streamID
- The stream description should be null
;it
will be ignored.
RemoteInputStream
The file as a remote input
stream.
com.sas.io.ChainedIOException
- If an I/O error occurs obtaining the remote
input stream.
java.rmi.RemoteException
- If a network anomaly is encountered.public java.lang.Object hasInputStream() throws java.rmi.UnmarshalException, java.rmi.RemoteException
getInputStream(java.lang.Object)
will succeed. See
getInputStream(java.lang.Object)
to determine whether this method
should be used.
hasInputStream
in interface com.sas.io.InputStreamProviderInterface
hasInputStream
in interface HTMLFileInterface
Object
non-null if getInputStream(java.lang.Object)
would succeed; throws UnmarshalException if it would fail
java.rmi.UnmarshalException
- if invoked on a remote obejct
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if this result package has already been
closed.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.public java.lang.String getEntityKey() throws java.lang.IllegalStateException, java.rmi.RemoteException
getEntityKey
in interface com.sas.entities.EntityKeyInterface
String
Throws:
java.rmi.RemoteException
- If a network anomaly is encountered.
java.lang.IllegalStateException
public boolean sameEntity(com.sas.entities.EntityKeyInterface entity) throws java.rmi.RemoteException
sameEntity
in interface com.sas.entities.EntityKeyInterface
java.rmi.RemoteException
public void setEntityKey(java.lang.String entityKey) throws java.rmi.RemoteException, java.lang.IllegalStateException
setEntityKey
in interface com.sas.entities.EntityKeyInterface
entityKey
- Unique entity key.
java.lang.IllegalStateException
- The unique entity key for a result package
or entry cannot be changed.
java.rmi.RemoteException
protected void closeEntry()
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 |