You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mario Ivankovits <ma...@ops.co.at> on 2007/01/31 15:12:03 UTC

Re: [VFS] How to rename a file?

Hi!
> Is there any simple way to rename a file?
>   
        FileObject foNew = VFS.getManager().resolveFile("abcNew.txt");
        VFS.getManager().resolveFile("abc.txt").moveTo(foNew);

moveTo issues a "copyTo/delete" or "move" operation depending if its on
the same filesystem or not.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org