1

I would expect this work.

FileSystemManager fileSystemManager = VFS.getManager();

FileObject fileObject = fileSystemManager.resolveFile("zip:res:hello.zip");

But I'm getting URI "res:hello.zip" is not an absolute file name.


With this I'm successfully getting my zip file, but not the files within the zip.

FileSystemManager fileSystemManager = VFS.getManager();

FileObject fileObject = fileSystemManager.resolveFile("res:hello.zip");

I have to wrap the zip lookup with a lookup of the url from a res lookup. This gets me a fileObject with the contents of the zip file.

FileSystemManager fileSystemManager = VFS.getManager();

FileObject fileObject = fileSystemManager.resolveFile("zip:" + fileSystemManager.resolveFile("res:hello.zip").getURL());

How can I use zip and res together without the ugly wrap call?

skaffman
  • 398,947
  • 96
  • 818
  • 769
dom farr
  • 4,041
  • 4
  • 32
  • 38
  • did you try res:zip:hello.zip? it seems more logically correct: first access resource and then recoginize the fact that it is a zip. – AlexR Jul 12 '11 at 19:51
  • Yes, that was my first "what if I do this..." type reaction. That and many others all failed. – dom farr Jul 13 '11 at 07:42

1 Answers1

0

It should be like this:

FileObject fileObject = fileSystemManager.resolveFile("zip:res://hello.zip");
Paolo
  • 1,641
  • 11
  • 15