[jcifs] Strange file copy problem

Hite, Sharon (NIH/NIEHS) [E] hite1 at niehs.nih.gov
Thu Sep 13 11:49:03 GMT 2007


I am trying to copy files from one server to another using JCIFS.  This
normally works pretty well.  However, when the only thing that changes
on the file is it's name, I can't get seem to overwrite the old file.
For example, I have a file called CamelCase.txt that I copy from Server1
to Server2.  Everything works fine.  I then change the name of the file
to camelcase.txt on Server1 and copy it to Server2.  The code executes
successfully, but I still see CamelCase.txt out on Server2.  Here is the
code I am using:
 
public static void main(String[] args) {

	// Load JCIFS properties
	jcifs.Config.setProperty('jcifs.smb.lmCompatitility","3");
	jcifs.Config.setProperty("jcifs.netbios.wins",myWinsIpAddress);
	
jcifs.Config.setProperty("jcifs.smb.client.username",myUserName);
	
jcifs.Config.setProperty("jcifs.smb.client.password",myPassword);
	jcifs.Config.setProperty("jcifs.smb.client.domain",myDomain);
	

	
	try {

		SmbFile src = new
SmbFile("smb://server1/camelcase.txt");
		SmbFile dest = new
SmbFile("smb://server2/camelcase.txt");
		src.copyTo(dest);

	} catch (Exception e) {

		e.printStackTrace();
		System.exit(-1);

	}

}

Anybody have any ideas what could be happening?
 
Thanks,
Sharon
 
 
 
 
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list