[jcifs] Strange file copy problem
Christopher R. Hertel
crh at ubiqx.mn.org
Thu Sep 13 18:42:54 GMT 2007
Sharon,
What kind of servers are these? Windows, Samba, or other?
Chris -)-----
Hite, Sharon (NIH/NIEHS) [E] wrote:
> 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
>
>
>
>
--
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/ -)----- Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/ -)----- ubiqx development, uninq
ubiqx Team -- http://www.ubiqx.org/ -)----- crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/ -)----- crh at ubiqx.org
More information about the jcifs
mailing list