Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to copy all the files in certain Directory and recreate the directory structure using java?  RSS feed

 
Gautam Bomma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of copying one file at a time. I am zipping all the files and unzipping them. I am using the below code to zip and unzip the files, but how do I unzip them and dynamically recreate the directory structure by the file description. for e.g: if the file is

c://users//desktop//635289512-251.txt

I need to place the file in

c://users//desktop//635_users//2895_access//635289512-251.txt

Thank you for you help.


 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this old thread: http://www.coderanch.com/t/455191/java/java/Compressing-Directory. Although that thread is about zipping, for unzipping you can use the same overall idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!