aspose file tools*
The moose likes I/O and Streams and the fly likes RMI  file service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "RMI  file service" Watch "RMI  file service" New topic
Author

RMI file service

Andrew Winton
Greenhorn

Joined: Oct 29, 2004
Posts: 3
Trying to create a remote file service using RMI. How can i allow clients to odtain a list of file names from the dir and also obtain the content of a specified file???

Hope someone can help!
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Take a look at the java.io.File class and the various InputStream/OutputStream and Reader/Writer classes provided in the java.io package also. The File class can be used on files or directories... File.list() returns an array of filenames if the File object is a directory. You would then open a FileInputStream or a FileReader, depending on whether you wanted to read binary or character information from the file.

Even though you may be doing this over RMI, this question involves just plain old Java file io, so I'll move this to the "I/O and Streams" forum.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI file service