The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.



Posted by Camila on November 28, 2001 at 4:04 AM

Hi Ahmed !

Unfortunately I'm writting to you not to solve your problema but to ask if you found a solution.... I just had the same problem and would be very usefull if you help me.

Thanks a lot.

Best regards,

> > > I can not get these methods to work. They do not do anything to the files that they are supposed to rename or delete and they both return false. Also, all the files are within the same directory as the application. Am I doing something wrong? Here's some sample code:

> > > // move the file from source to destFile
> > > File source = new File(path);
> > > File destFile = new File(String new_name);
> > > source.renameTo(destFile);

> > //I have a Button("source directory") in my programm, i choose a Directory(source) from (FileChooser)
> > //I put a new_name in a InputField, I have Button ("Ok")
> > //I want the same File(source), but with the another name( new_name) which i put
> > //after Compiling i becom--> Error (System FileNotFoundException)

> > > Please help!


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us