• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extraction code  RSS feed

 
kavi lathigra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

This is a snippet code that im developing. (no source of it)
Im facing a trouble to extract file in the same directory as the source file (example: extract here option)

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of problem? What does the code do now, and what were you expecting instead? If there were any exceptions, post the stack trace.
 
kavi lathigra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is that, the file is getting extracted in C itself, but what I want is that, wherever the compressed file is , i want it to be extracted in the same location
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't really visualize that. Please post the layout of the file system is it is happening now, and how you would like it to happen.
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain the purpose of doing zipFilePath.substring(0,zipFilePath.length())

Also, if you creating the output in the same directory as the source file, why are you checking if the directory exists and if not creating it - surely it has to exist if the zip file exists.

BTW your problem is that when you create your FileOutputStream you aren't adding the path to the zip file so you are creating the extracted files relative to the current directory or relative to the root of the drive if 'newFile' starts with\ or /
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!