com.vistech.rmi
Class SimpleImageServer
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--com.vistech.rmi.SimpleImageServer
- All Implemented Interfaces:
- DirectoryBrowser, ImageLoader, java.rmi.Remote, java.io.Serializable
- Direct Known Subclasses:
- JAIImageServer
- public class SimpleImageServer
- extends java.rmi.server.UnicastRemoteObject
- implements ImageLoader
A remote server application that lists and loads
images as file input streams.
- Version:
- 1.0 12 june 2000
- Author:
- Lawrence Rodrigues
- See Also:
- Serialized Form
Field Summary |
protected java.lang.String |
userDir
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Method Summary |
char |
getFileSepChar()
Returns the file separation character of the remote machine. |
java.lang.String |
getUserDir()
Returns the user directory in the remote machine. |
boolean |
isDirectory(java.lang.String file)
Checks whether the remote file is a directory. |
java.lang.String[] |
listFiles()
Returns files in the current directory of the remote machine. |
java.lang.String[] |
listFiles(java.lang.String file)
Returns files in a specified directory of the remote machine. |
byte[] |
loadImageAsBytes(java.lang.String filename)
Loads an image as an array of bytes. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
userDir
protected java.lang.String userDir
SimpleImageServer
public SimpleImageServer()
throws java.rmi.RemoteException
listFiles
public java.lang.String[] listFiles()
throws java.rmi.RemoteException
- Description copied from interface:
DirectoryBrowser
- Returns files in the current directory of the remote machine.
- Specified by:
listFiles
in interface DirectoryBrowser
- Following copied from interface:
com.vistech.rmi.DirectoryBrowser
- Returns:
- an array of remote filenames.
isDirectory
public boolean isDirectory(java.lang.String file)
- Description copied from interface:
DirectoryBrowser
- Checks whether the remote file is a directory.
- Specified by:
isDirectory
in interface DirectoryBrowser
- Following copied from interface:
com.vistech.rmi.DirectoryBrowser
- Parameters:
fl
- name of the remote directory.- Returns:
- true if it is a directory.
getFileSepChar
public char getFileSepChar()
- Description copied from interface:
DirectoryBrowser
- Returns the file separation character of the remote machine.
- Specified by:
getFileSepChar
in interface DirectoryBrowser
- Following copied from interface:
com.vistech.rmi.DirectoryBrowser
- Returns:
- the file separation character of the remote machine.
listFiles
public java.lang.String[] listFiles(java.lang.String file)
throws java.rmi.RemoteException
- Description copied from interface:
DirectoryBrowser
- Returns files in a specified directory of the remote machine.
- Specified by:
listFiles
in interface DirectoryBrowser
- Following copied from interface:
com.vistech.rmi.DirectoryBrowser
- Parameters:
fl
- name of the remote directory.- Returns:
- an array of remote filenames.
getUserDir
public java.lang.String getUserDir()
throws java.rmi.RemoteException
- Description copied from interface:
DirectoryBrowser
- Returns the user directory in the remote machine.
- Specified by:
getUserDir
in interface DirectoryBrowser
- Following copied from interface:
com.vistech.rmi.DirectoryBrowser
- Returns:
- the user directory in the remote machine.
loadImageAsBytes
public byte[] loadImageAsBytes(java.lang.String filename)
throws java.rmi.RemoteException
- Description copied from interface:
ImageLoader
- Loads an image as an array of bytes.
- Specified by:
loadImageAsBytes
in interface ImageLoader
- Following copied from interface:
com.vistech.rmi.ImageLoader
- Parameters:
the
- name of the image in the remote directory.- Returns:
- an array of image bytes.
main
public static void main(java.lang.String[] args)