Class.getResource returns wrong URL ?

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

Class.getResource returns wrong URL ?

Bartosz Baranowski
Hi
Ive found something weird in AS7 resource lookup - to be precise, below code executed in AS7 gives output like:


Class c = this.getClass();
URL u1 = c.getResource("../");
URL u2 = c.getResource("../../");



_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Class.getResource returns wrong URL ?

Bartosz Baranowski
Sorry, hit some shortcut, so:

Class c = this.getClass();
URL u1 = c.getResource("../");
URL u2 = c.getResource("../../");
URL u3 = c.getResource("../../../");
URL u4 = c.getResource("../../../../");

Gives sometimes like:

u1 = vfs:/content/test.war/WEB-INF/classes/org/jboss/as/test/pk1/
u2 = vfs:/content/jtest.war/WEB-INF/classes/org/jboss/as/test/
u3 = jar:file:/home/baranowb/git/jboss-as/build/target/jboss-as-7.1.1.Final-SNAPSHOT/modules/org/jboss/as/ejb3/main/jboss-as-ejb3-
u4 = jar:file:/home/baranowb/git/jboss-as/build/target/jboss-as-7.1.1.Final-SNAPSHOT/modules/org/jboss/ejb-client/main/jboss-ejb-client-1.0.3.Final.jar!/org/jboss/

Seems a bit wrong, doesnt it ?

----- Original Message -----
From: "Bartosz Baranowski" <[hidden email]>
To: [hidden email]
Sent: Thursday, March 8, 2012 10:31:03 AM
Subject: [jboss-as7-dev] Class.getResource returns wrong URL ?

Hi
Ive found something weird in AS7 resource lookup - to be precise, below code executed in AS7 gives output like:


Class c = this.getClass();
URL u1 = c.getResource("../");
URL u2 = c.getResource("../../");



_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev