user3626038
user3626038

Reputation: 27

Directory Name is Invalid when navigating into .zip file

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

Answers (3)

granmirupa
granmirupa

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

Ruudy Garcia
Ruudy Garcia

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

Retro Gamer
Retro Gamer

Reputation: 1112

Extract the .zip file first before you navigate into it. Some things remain hidden until it is unzipped.

Upvotes: 0

Related Questions