URLInputStream("jar:file:/Z:/some/where.jar!/META-INF/MANIFEST.MF") ???

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

URLInputStream("jar:file:/Z:/some/where.jar!/META-INF/MANIFEST.MF") ???

Schuett, Thomas (EXT)
Hello,

even if i wasn't expecting the constructor "File(URI)", it is existant.
But then again
   new File(new
URI("jar:file:/Z:/some/where.jar!/META-INF/MANIFEST.MF"))
says:
   java.lang.IllegalArgumentException: URI is not hierarchical

I am a bit irritated about that. It looks like it looks behind the first
":", doesn't find
a "/" there, and concludes, that the file is not absolute :-(

Then I found your VFS project, but aren't much more happy yet:

In the docu it says for jar file systems:
   URI Format
   [...]
   jar:// arch-file-uri[! absolute-path]
So, after a "jar" there must directly follow a "://".
But the example a few lines below says:
   jar:../lib/classes.jar!/META-INF/manifest.mf
This is a dissarcord, isn't it?

But o.k., skip the docu and look into the API:
There is a JarFileSystem, but only with the constructor
   JarFileSystem(FileName rootName, FileObject file, FileSystemOptions
fileSystemOptions)
Well, this is a bit to complicated for what I am looking for.
I would expect something I can instantiate just by giving a URI (or
actually by a URL!)
and get a InputStream. (And of course actually I would expect it in the
basic java language.)

Am I am wanting too much?
Hopefully I am just looking in the wrong corners.

Thanks for any answers,
 Thomas




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] URLInputStream("jar:file:/Z:/some/where.jar!/META-INF/MANIFEST.MF") ???

Mario Ivankovits
Schuett, Thomas (EXT) wrote:

>Then I found your VFS project, but aren't much more happy yet:
>
>In the docu it says for jar file systems:
>   URI Format
>   [...]
>   jar:// arch-file-uri[! absolute-path]
>So, after a "jar" there must directly follow a "://".
>But the example a few lines below says:
>   jar:../lib/classes.jar!/META-INF/manifest.mf
>This is a dissarcord, isn't it?
>  
As a VFS start you can do:
FileObject fo =
VFS.getManager().resolveFile("jar:file://Z:/some/where.jar!/META-INF/MANIFEST.MF");

This will do what you want.


I'll try to polish the docu :-)

---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

AW: [VFS] URLInputStream("jar:file:/Z:/some/where.jar!/META-INF/MANIFEST.MF") ???

Schuett, Thomas (EXT)
In reply to this post by Schuett, Thomas (EXT)
Ups - nearly overseen this answer in the flood of postings :-)

> As a VFS start you can do:
> FileObject fo =
>
VFS.getManager().resolveFile("jar:file://Z:/some/where.jar!/META-INF/MAN
IFEST.MF");
>
> This will do what you want.

Sounds good. However, as I have overseen this reply in the first hand,
I tried by myself, going to use JarFile, and splitting the URI at the
"!"
by myself.

But I am sure I can need your approach for more general problems
somewhere in the future.

Thanks for help!
 Thomas

> I'll try to polish the docu :-)
:-)


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]