This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI file service

 
Andrew Winton
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic