try creating new file at the new location and the delete the old file. File myFile1 = new File(filename); File myFile2 = new File(newpath+filename); boolean succes = myFile1.renameTo(myFile2); if(success){ myFile1.delete(); }
suc6 Maarten -----Oorspronkelijk bericht----- Van: Martin Gainty [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 13 december 2005 20:53 Aan: Tomcat Users List Onderwerp: Re: Moving a file Jef et al Have you tried the URL Spec e.g file://folder/subfolder/filename for URL file specs see http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Demo/url-primer.html Anyone else ? M- ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "Tomcat Users List" <users@tomcat.apache.org> Sent: Tuesday, December 13, 2005 1:18 PM Subject: RE: Moving a file >> -------- Original Message -------- >> Subject: RE: Moving a file >> From: "Jef Sullivan" <[EMAIL PROTECTED]> >> Date: Tue, December 13, 2005 10:17 am >> To: "'Tomcat Users List'" <users@tomcat.apache.org> >> >> Additionally, >> The error that I am getting is the file does not exist. >> Yet, the file does exists. I have verified its location, >> and the spelling of the path and filename. Everything >> matches including the case sensitivity. > > Your code example doesn't provide a path to the original file. You > probably need that. Try using a full path or a path relative to the > default dir TC is looking in (I think it's $INSTALLDIR/bin on Linux > installs). > > _M_ > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/198 - Release Date: 12-12-2005 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/198 - Release Date: 12-12-2005 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]