[jcifs] How to create a directory on remote server

desi_v vgupta at duke-energy.com
Wed Jul 18 14:05:43 GMT 2007


Hi ,

I am trying to create a directory called exp99 as shown below on a windows
share and I am using the following code and getting null pointer exception.
Note: this is the first time I am trying jcifs. Can somebody help?

do I need to do anything extra ?

import jcifs.smb.*;

/**
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class TestSmb {

	/**
	 * 
	 */
	public TestSmb() {
		super();
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {
	
		String temp1 =   "smb:\\"  +  "\\server1" + "\\" +  "W_sc\\" + "ZTemp\\" +
"exp99";
		try {		

			(new SmbFile(temp1)).mkdir();		
			
		  
				
			System.out.println("completed");		
		} catch (Exception e) {
			e.printStackTrace();
		}
		

	}
}

-- 
View this message in context: http://www.nabble.com/How-to-create-a-directory-on-remote-server-tf4103428.html#a11669314
Sent from the Samba - jcifs mailing list archive at Nabble.com.



More information about the jcifs mailing list