Results 1 to 2 of 2

Thread: Url i/o

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

    Default Url i/o

    If I can do this:
    URL url = new URL("ftp://user01/README.txti");
    URLConnection urlc = url.openConnection();
    InputStream is = urlc.getInputStream(); // To read
    OutputStream os = urlc.getOutputStream(); // To write

    Then why can't I do this:
    URL url = new URL("afp://user01/README.txt");
    InputStream is = urlc.getInputStream(); // To read
    OutputStream os = urlc.getOutputStream(); // To write

    (afp is for Macs)
    (I don't want to use http)

    I vaguely remember on windows all I had to do was \\hostname\dir\aFile.txt and it just worked (I thought I used the File class not a URL). I take it I have to use a URL with smb:, nfs: , etc. for everyone else?

  2. #2
    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 to make sure my file shares are mounted?

    Why in the world am I told to use nfs,ftp,smb,http,... etc?

Posting Permissions

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