commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [VFS] How to rename a file?
Date Wed, 31 Jan 2007 14:12:03 GMT
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


Mime
View raw message