File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes How rename a Directory ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How rename a Directory ?" Watch "How rename a Directory ?" New topic
Author

How rename a Directory ?

Srinivasa Vallabha
Greenhorn

Joined: Mar 08, 2001
Posts: 15
Hi all,
I want to rename a directory, i know using renameTo() method we have to create file objects all the files which are there in a directory to its destination and then we need to delete the old one. But my question is, there is any other way to do this ?
Please help me....
thankx
Srinivasa Vallabha
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Srinivasa,
A File object can point to a file or a directory. All methods will work regardless of which is used. Therefore, you can easily do the following:

and it will work!
Regards,
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How rename a Directory ?