Reputation: 27
I seem to be having trouble navigating into a .zip file via command line.
If I put the following statement into command line:
"C:\Program Files(x86)\Java\jre6\core.zip"
and hit enter, cmd line will open up the zip folder which is great. But I then want to navigate to "bin" folder within the zip folder:
"C:\Program Files(x86)\Java\jre6\core.zip\bin"
and for this line, command line throws an error and says that the directory name is invalid.
This doesnt make much sense to me considering the cmd line was able to navigate successfully into the .zip file.
Any help would be appreciated
Upvotes: 0
Views: 589
Reputation: 2790
If you are making by Java you can use ZipEntry
.
ZipFile zipFile = new ZipFile("C:/myZip.zip"); // use for get the zip
zipFile.entries(); // get the entries;
For more you can read here.
Upvotes: 0
Reputation: 139
Zip file's content cannot be accessed automatically using Java. You should extract the desired content into a temporary folder in order to access it. But when you don't know the type of the item you are trying to extract (folder or file), it would be better to extract all the zip, test if the resource is a file or folder and do some treatment regading it.
Upvotes: 1
Reputation: 1112
Extract the .zip file first before you navigate into it. Some things remain hidden until it is unzipped.
Upvotes: 0