• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Moving files (urgent)

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
i have a problem in moving files from one directory to the another in JSP, Say i have some two to three files in a folder "A" and i want move all this files to the another folder "B".How can i do this.
please help me out.
Thanks
Ramkumar.c
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would use java.io.File:
create a File object for each file that you need in folder "A", then use the renameTo(File) method to rename(move) the files into "B" folder. (you have to create File's in folder "B" that corresponds for each File in "A")
Does this help, or do you need more specifics?
 
ramkumar chandramohan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
Ya i did, but still i am getting a problem , can u give me some more details.This what i did...
<%
java.io.File f1=new java.io.File("F:/test/1.html");
java.io.File f2=new java.io.File("F:/test/2.html");
out.println(f1.renameTo(f2));
%>
please suggest me..
Thanks
Ramkumar.c

Originally posted by dagmar timler:
You would use java.io.File:
create a File object for each file that you need in folder "A", then use the renameTo(File) method to rename(move) the files into "B" folder. (you have to create File's in folder "B" that corresponds for each File in "A")
Does this help, or do you need more specifics?


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic