|
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.Objectdemo.rmi.filesystem.client.FileSystemClient
public class FileSystemClient
A sample file system client. It performs several manipulations on the remote file system. The client can be used with Windows or Unix based server, and it tries to locate the WINDOWS directory (or the /usr directory) on the server and work inside that directory. It is possible to operate on the entire file system, but then this example would take many minutes (~20 mins) to complete, depending on the number of files on the server. See the methods of this class for more information.
| Nested Class Summary | |
|---|---|
private static class |
FileSystemClient.SemiPalindromeFilter
A filter that accepts what can be called a "semi-palindromic" file names. |
| Constructor Summary | |
|---|---|
FileSystemClient()
|
|
| Method Summary | |
|---|---|
private static void |
countFilesAndDirs(IRemoteFile root)
Count the number of files and directories under the provided root. |
private static void |
findSemiPalindromes(IRemoteFile root,
boolean export)
Find all semi-palindromic file names. |
private static void |
findWindowsDlls(IRemoteFile root)
Scan the directory tree for files that end with .dll. |
private static IRemoteFile |
getSampleOSDir(IRemoteFileSystem fs)
Return the "working" directory that will be used as a root for all other methods. |
static void |
main(String[] args)
|
private static void |
printFirstLineOf(IRemoteFile file)
Print the first line of a remote file. |
private static void |
printTextFiles(IRemoteFile root)
Print the first line of remote text files. |
private static void |
scanByExtension(IRemoteFile parent,
String ext)
The actual implementation of findWindowsDlls(IRemoteFile) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSystemClient()
| Method Detail |
|---|
private static void countFilesAndDirs(IRemoteFile root)
throws RemoteException
root - the root at which the scan is performed.
RemoteException
private static void findSemiPalindromes(IRemoteFile root,
boolean export)
throws RemoteException
export is true, the method will export the file filter object
and the server will make callbacks to our JVM when it calls
FileSystemClient.SemiPalindromeFilter.accept(IRemoteFile, String).
If export is false, then the FileSystemClient.SemiPalindromeFilter class
itself (and not it's stub) will be loaded by the server and executed on
the server.
root - export -
RemoteException
private static void findWindowsDlls(IRemoteFile root)
throws RemoteException
RemoteException
private static IRemoteFile getSampleOSDir(IRemoteFileSystem fs)
throws RemoteException
RemoteExceptionpublic static void main(String[] args)
private static void printFirstLineOf(IRemoteFile file)
throws IOException
IOException
private static void printTextFiles(IRemoteFile root)
throws IOException
IOException
private static void scanByExtension(IRemoteFile parent,
String ext)
throws RemoteException
findWindowsDlls(IRemoteFile)
RemoteException
|
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.