So what is 'realPath'? Is it path to some jar (that is something like 'c:\Bla\Bla\somejar.jar')? Is it path obtained from some java.io.File (that is path in terms of native file system)? And which file you need to find in a jar? Do you know its path inside jar?
I am trying to get the contents of a file in a jar file. I find the
correct file system by using the following code: >
VirtualFileManager vfm = VirtualFileManager.getInstance();
> VirtualFileSystem[] fileSystems = vfm.getFileSystems();
> for (int i = 0; i < fileSystems.length; i++) {
> VirtualFileSystem fileSystem = fileSystems+;
> if (!"dummy".equals(fileSystem.getProtocol())) {
> VirtualFile fileByPath =
fileSystem.findFileByPath(realPath);
> if (fileByPath != null) {
> // found the file, how do I get the contents???
> }
> }
> }
>
> ]]>
Try the attached plugin. Its not complete yet. Its an editor for Jar files and shows you the content. The opening of the files directly out of the jar is not done yet.
Sven
Todd Breiholz wrote:
I am trying to get the contents of a file in a jar file. I find the correct file system by using the following code:
VirtualFileManager vfm = VirtualFileManager.getInstance();
> VirtualFileSystem[] fileSystems = vfm.getFileSystems();
> for (int i = 0; i < fileSystems.length; i++) {
> VirtualFileSystem fileSystem = fileSystems+;
> if (!"dummy".equals(fileSystem.getProtocol())) {
> VirtualFile fileByPath = fileSystem.findFileByPath(realPath);
> if (fileByPath != null) {
> // found the file, how do I get the contents???
> }
> }
> }
>
> ]]>
So what is 'realPath'? Is it path to some jar (that is something like
'c:\Bla\Bla\somejar.jar')? Is it path obtained from some java.io.File (that
is path in terms of native file system)?
And which file you need to find in a jar? Do you know its path inside jar?
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Todd Breiholz" <no_mail@jetbrains.com> wrote in message
news:16358262.1070443068296.JavaMail.javamailuser@localhost...
correct file system by using the following code:
>
>
>
>
Try the attached plugin. Its not complete yet. Its an editor for Jar
files and shows you the content. The opening of the files directly out
of the jar is not done yet.
Sven
Todd Breiholz wrote:
Attachment(s):
previewPlugin.jar