commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Fortner <phidia...@yahoo.com>
Subject Re: VFS Questions
Date Mon, 02 Jan 2006 20:08:15 GMT
Valerio,
Thanks for the input, however, I'm trying to use the VFS library to 
handle the file operations.  This would allow me to rename files sitting 
on NFS volumes, or WebDAV volumes.  The example you gave me was for the 
java.io.File object which would only work for local files.

Thanks anyway,

Mark

Valerio Schiavoni wrote:

>Hi Mark
>
>2006/1/2, Mark Fortner <phidias51@yahoo.com>:
>  
>
>>   4. I'd like to be able to rename a file.  But I don't see a very
>>      straightforward way of doing it.  There's a move method, and a
>>      canBeRenamedTo method, but nothing that explicitly allows me to
>>      rename the file and that takes a string.  This might be added to
>>      FileUtil if you want to keep the current API the same.
>>    
>>
>
>
>my 2 cents:
>
>    // File (or directory) with old name
>    File file = new File(*"oldname"*);
>
>    // File (or directory) with new name
>    File file2 = new File(*"newname"*);
>
>    // Rename file (or directory)
>    boolean success = file.renameTo(file2);
>    if (!success) {
>        // File was not successfully renamed
>    }
>
>hope it helps.
>
>cheers,
>valerio
>
>   5. There doesn't seem to be an easy way to "select" a file.  For
>  
>
>>      example, if you are creating a table model and you want to display
>>      a checkbox to indicate that the file is selected, there isn't a
>>      method like "isSelected" to determine if the file is currently
>>      selected.
>>
>>Mark Fortner
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>--
>To Iterate is Human, to Recurse, Divine
>James O. Coplien, Bell Labs
>
>  
>


---------------------------------------------------------------------
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