|
02/28/2005 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Package Summary
| Class Summary | |
| FileRemoteRequest | Models a request to the file system for content. |
| FileRemoteResponse | Models a response from a request to the file system for content. |
| FileRemoteSession | Models a session for retrieving content from the filesystem. |
RSM implementation to retrieve content from the file system.
Although the file system does not represent a true protocol, this form of content retrieval is frequently used and fits well into the request-response paradigm.
Client code will start use of the API by creating a session. The RemoteSessionFactory object contains a factory method (createRemoteSession()) that creates a session for a given protocol. If the protocol is unknown or unsupported, an UnsupportedProtocolException is thrown.
try {
RemoteSession session = RemoteSessionFactory.createRemoteSession("file");
} catch (UnsupportedProtocolException e) {}
This creates a representation in your code of a session on a remote server. The session object can then be cast to the appropriate protocol-specific session implementation to set specific session information:
if (session instanceof FileRemoteSession) {
FileRemoteSession file_session = (FileRemoteSession)session;
}
The session is then used to create and perform the request:
URL url = new URL("file:///usr/local/myfile.txt");
FileRemoteRequest file_request = (FileRemoteRequest)file_session.createRequest(url);
FileRemoteResponse file_response = (FileRemoteResponse)file_request.performRequest(5000);
The FileRemoteResponse object is then used to retrieve the content in one of three methods:
getInputStream() method to obtain an InputStreamretrieveByteContent() to retrieve a byte arrayretrieveStringContent() in conjunction with an implementation of ByteToStringConverter to obtain a String
FileData,
com.vignette.portal.rsm
|
02/28/2005 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||