permaculture playing cards*
The moose likes Java in General and the fly likes Get Files from jar. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Get Files from jar." Watch "Get Files from jar." New topic
Author

Get Files from jar.

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Hai all,
I have a query that i need to set the path a File

File file =new File("............");

I need to pass the path of some files that is inside a jar
i mean that file is inside the com.org.Test.

How i pass the path of a jar?

Can Anybody help me .....


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I don't think it's possible with Files, but only with URLs. Take a look at java.net.JarURLConnection.

Doesn't sound like a testing-specific question, though. Moving to Java in General (intermed.)...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
jQuery in Action, 2nd edition
 
subject: Get Files from jar.
 
Similar Threads
jar not ok when in different folder
JAR FileNotFoundException
Using a directory inside of a JAR file
jar runs on desktop but not laptop
Help please...jar problem