[jcifs] New to jcifs

Laura McCord mccordl at southwestern.edu
Tue Apr 17 21:24:13 GMT 2007


I need a little help getting started with jcifs.

This is what I have so far:

import java.io.PrintStream;
import java.net.URL;
import jcifs.Config;
import jcifs.smb.*;
import jcifs.smb.SmbFile;


public class PhotoRetrieval {
    public static void main(String[] args){
        System.out.println("testing");
        Config.setProperty("jcifs.netbios.wins", "ipaddress");
        Config.setProperty("jcifs.smb.client.domain", "ourdomain");
        Config.setProperty("jcifs.smb.client.username", "myusername");
        Config.setProperty("jcifs.smb.client.password", "mypassword");
        System.out.println("testing");
        try{
            SmbFileInputStream in = new
SmbFileInputStream("smb://ipaddress/idworks/Image002/20060725/273251.jpg");
            System.out.println("in is " + in);
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}


I guess one question is that is it ok that the ipaddress that I use with
jcifs.netbios.wins is also used here smb://ipaddress/idworks.... I was
given one ipaddress which isUNC path that I use to get to the file that
I need. Also, how would I use jcifs to display a jpeg like I have done here?

Thanks,
 Laura


More information about the jcifs mailing list