Re: move file to a directory wit
"Trent Albright" <[email protected]>
| Newsgroups | gmane.org.user-groups.trijug.juglist |
|---|---|
| Message-ID | <[email protected]> |
Just grabbed this off google, would it work for you, or do you have to
use cmd for some reason?
http://java.sun.com/j2se/1.3/docs/api/java/io/File.html
// File (or directory) to be moved
File file = new File("filename");
// Destination directory
File dir = new File("directoryname");
// Move file to new directory
boolean success = file.renameTo(new File(dir, file.getName()));
if (!success) {
// File was not successfully moved
On 5/4/06, Manon Baratt <mab1777-/[email protected]> wrote:
> I am trying to move a file from where it is to another directory. The
> destination directory has spaces in its name. This is the command I am
> using:
>
> String command = "cmd /c move " + file + " " + destDir;
>
> How do I get this code working? Do I use urlencoding?
>
> Thanks.
>
> ________________________________
> Yahoo! Mail goes everywhere you do. Get it on your phone.
>
>
>
> _______________________________________________
> Juglist mailing list
> [email protected]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
>
>
>