|
Back to the RMI Plug-in for Eclipse
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.File
demo.rmi.filesystem.server.RemoteFileImpl
public class RemoteFileImpl
This class implements the IRemoteFile interface for
the local file system. The implementation extends the standard
File class. Some methods already appear in the File
class with the same signature as required by the interface and
therefore you don't see their implementation here.
As you can see this class does not extend UnicastRemoteObject,
which means we have to manually export the remote implementations
using the UnicastRemoteObject.exportObject(java.rmi.Remote)
method.
This implementation tries to be as efficient as it can be, but
you should remember that the whole design is not very efficient itself.
The interesting methods in terms of two-way communications are the methods
that filter the file system. See their docs and the docs in the interface
for more information.
| Field Summary | |
|---|---|
private static long |
serialVersionUID
|
| Fields inherited from class java.io.File |
|---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
| Constructor Summary | |
|---|---|
RemoteFileImpl(RemoteFileImpl parent,
String child)
Create a new remote file object that is a child of this directory. |
|
RemoteFileImpl(String pathname)
Create a new remote file object with a given path. |
|
| Method Summary | |
|---|---|
String |
getCanonicalPath()
|
IRemoteFile |
getChild(String name)
Return a file that is a child of the current directory. |
IRemoteInputStream |
getInputStream()
Return a remote input stream that can be used to read from the file. |
RemoteFileImpl |
getRemoteAbsoluteFile()
|
RemoteFileImpl |
getRemoteParentFile()
|
IRemoteFile[] |
listByFilter(IRemoteFilenameFilter filter)
This method uses a remote filename filter which will result in callbacks to the client (the user of this interface) for every filename (if the implementing object is exported). |
IRemoteFile[] |
listByRegex(String regex,
boolean dirsOnly)
Return the files in this directory that their names (only the last segment) match the regular expression supplied as the regex argument. |
IRemoteFile[] |
listRemoteDirectories()
This method returns the subdirectories of the current directory. |
IRemoteFile[] |
listRemoteFiles()
Return the files in this directory as IRemoteFiles. |
| Methods inherited from class java.io.File |
|---|
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface demo.rmi.filesystem.common.IRemoteFile |
|---|
canRead, canWrite, exists, getAbsolutePath, getName, getParent, getPath, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list |
| Field Detail |
|---|
private static final long serialVersionUID
| Constructor Detail |
|---|
public RemoteFileImpl(RemoteFileImpl parent,
String child)
throws RemoteException
RemoteException
RemoteFileImpl(String pathname)
throws RemoteException
RemoteFileSystemImpl.getRoots().
RemoteException| Method Detail |
|---|
public String getCanonicalPath()
throws RemoteException
getCanonicalPath in interface IRemoteFilegetCanonicalPath in class FileRemoteException
public IRemoteFile getChild(String name)
throws RemoteException
IRemoteFileFile.File(File, String)), since
interfaces can't declare constructors.
getChild in interface IRemoteFilename - the child's name.
RemoteException
public IRemoteInputStream getInputStream()
throws RemoteException
IRemoteFileIRemoteInputStream
with a conventional InputStream.
getInputStream in interface IRemoteFileRemoteExceptionIRemoteInputStream
public RemoteFileImpl getRemoteAbsoluteFile()
throws RemoteException
getRemoteAbsoluteFile in interface IRemoteFileRemoteException
public RemoteFileImpl getRemoteParentFile()
throws RemoteException
getRemoteParentFile in interface IRemoteFileRemoteException
public IRemoteFile[] listByFilter(IRemoteFilenameFilter filter)
throws RemoteException
IRemoteFile
listByFilter in interface IRemoteFilefilter - the filename filter.
RemoteException
public IRemoteFile[] listByRegex(String regex,
boolean dirsOnly)
throws RemoteException
IRemoteFileregex argument.
listByRegex in interface IRemoteFileregex - the regular expression filter for the childs filename.dirsOnly - If true, only subdirectories will be considered.
RemoteExceptionString.matches(String);
public IRemoteFile[] listRemoteDirectories()
throws RemoteException
IRemoteFileIRemoteFile.listByFilter(IRemoteFilenameFilter).
listRemoteDirectories in interface IRemoteFileRemoteException
public IRemoteFile[] listRemoteFiles()
throws RemoteException
IRemoteFileIRemoteFiles.
listRemoteFiles in interface IRemoteFileRemoteException
|
Back to the RMI Plug-in for Eclipse
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
© 2002-12 Genady Beryozkin, rmi-info@genady.net. Read our Privacy policy. Hosted on RimuHosting. Visit Javalobby.