Results 1 to 5 of 5

Thread: FileServer

  1. #1
    Satch is offline Member
    Join Date
    Jul 2010
    Posts
    7
    Rep Power
    0

    Default FileServer

    How do I read and write to a file server? The File class is designed for local drives. I have not been able to find any examples.

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    it depends on the kind of network protocol the file server is using.

    ftp : commons-net project has a ftp client
    window cifs: the jcifs project

    another one that does both of these and nfs: JFtp - Open Source FTP, SFTP, NFS and SMB file transfer client and more

    for http there is commons-http client (HTTP post/gets) dav4j (webDAV)

    and if needing to use subversion, there is the svnkit project

    there used to be an apache commons-vfs that provided sensible interfaces for all kinds of abstract file system back ends, so your application would compile against that, and any crazy file server protocol could be included as a module or kind of plugin to that.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by Satch View Post
    How do I read and write to a file server? The File class is designed for local drives. I have not been able to find any examples.
    Read more about files servers, what it is really doing? Then model your one and make a design of yours. After that start to implement it. But it won't be an easy task.


  4. #4
    Satch is offline Member
    Join Date
    Jul 2010
    Posts
    7
    Rep Power
    0

    Default File Server IO

    Good grief. All I got to do is use the /Volumes/<file share>pathname! It just has to be mounted to use the Java File class. I've added the /Volumes/<file share> to the login items list for a user account who is automatically logged in on startup.

    Is there a better way?

  5. #5
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    oh, well then if you can ensure the network share has been mounted by the operating system as /Volumes/${shareName} and the user executing the java program has the permissions to read/write files in this path, then this really behaves like any regular file on the file system, and using the standard java.io.File will work.
    (e.g. searching for examples for Java read and write to a file should be good)

Similar Threads

  1. Upload image form client to fileserver
    By eratek in forum Networking
    Replies: 0
    Last Post: 03-20-2009, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •