-1

FileSystems.getFileSystem throws FileSystemNotFoundException at line ZipFileSystemProvider.java:171

What should i do to overcome that ? Thanks in advance...

public void copy(File sourceFile){
Path zipfile = Paths.get(sourceFile.getAbsolutePath());
URI uri = URI.create("jar:" + zipfile.toUri());
FileSystem fs = FileSystems.getFileSystem(uri);
Path nf = fs.getPath("new.txt");
.....    

}
fatih
  • 105
  • 9
  • that was realated to classloader and nio. but my scenario is i got a existing a zip file in a given directory and add a file inside it, during that throws given exception. – fatih Jun 29 '15 at 12:16

1 Answers1

0

According to Oracle documentation the correct uri prefix is jar:file:

Sharon Ben Asher
  • 13,849
  • 5
  • 33
  • 47