commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadim Murr" <>
Subject VFS & jar files
Date Wed, 15 Nov 2006 08:27:43 GMT


I'm using commons VFS to read and write on different sources. I managed
to read and write on a file system source, ftp source...

My problem is the following; when dealing with jar or zip files, I'm not
able to write, and more specifically I can't create a new folder inside.

Check out the following code:

    FileObject fo = manager.resolveFile("file://C:/c3dq/file.jar");

    FileObject jarSys = manager.createFileSystem(fo);

    FileObject folder = jarSys.resolveFile("new");



I can read the jar file, and list its children, but when I call the
createFolder() method I get the following exception:


org.apache.commons.vfs.FileSystemException: Could not create folder
"jar:file://C:/c3dq/file.jar!/new" because its parent folder is




Is there anyway I can create new folder and files inside the jar itself?


Another question is: Is there a way to access a password protected jar
file in VFS?


Thank you...




  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message