question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I create a zip FileSystem for a zip in a jimfs FileSystem?

See original GitHub issue

I found this, so I think it’s supported, but I don’t know how to use it.

Attempt 1

FileSystems.newFileSystem(
    pathToZipFile.toUri(),
    Collections.singletonMap("create", "true"));
java.lang.IllegalArgumentException: 
  uri (jimfs://814e6cd3-0d35-4c8f-a93d-62f44ffd3825/work/stuff.zip) 
  may not have a path, query or fragment

Attempt 2

FileSystems.newFileSystem(pathToZipFile, null)
java.nio.file.ProviderNotFoundException: Provider not found

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bukefaloscommented, Jun 27, 2017

This worked for me:

FileSystems.newFileSystem(
    URI.create("jar:" + pathToZipFile.toUri()),
    Collections.singletonMap("create", "true"));
0reactions
ronshapirocommented, May 13, 2019

Closing this given that it’s stale and lacking some information. If it’s still an issue, comment and we can reopen it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bundling zip files in memory with Java - Stack Overflow
Apperatnly there is a way to bundle ZipFS with JIMFS - that is, to treat a file (which is stored in memory -...
Read more >
Working with Zip File System in Java - OpenGenus IQ
In this article, we will work with ZIP file system in Java and see how we can move or copy files to ZIP,...
Read more >
Jimfs by google - GitHub Pages
Jimfs. Jimfs is an in-memory file system for Java 7 and above, implementing the ... Creating, deleting, moving and copying files and directories....
Read more >
Create Java Zip File Using FileSystem Object
This Java Example shows how to create zip file using Java's FileSystem API. In this example, we will pack two text files into...
Read more >
com.google.common.jimfs.Jimfs java code examples - Tabnine
Jimfs.newFileSystem(...) /** * Creates a new in-memory file system with the ... addSource(zip) .load(); Profile profile = new ProfileLoader(fileSystem, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found