aspose file tools
The moose likes Java in General and the fly likes Locating the path of a runtime dependency archive file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Locating the path of a runtime dependency archive file" Watch "Locating the path of a runtime dependency archive file" New topic
Author

Locating the path of a runtime dependency archive file

Arundhathi Menon
Ranch Hand

Joined: Jan 14, 2004
Posts: 113
Hi,

I need to locate the path of the file - rampart.mar which I have placed in the folder <proj>/lib

To locate the path at runtime, I tried executing the command :



It fails!

I realised that since my output folder in eclipse is set to build/classes , all the resource files that are placed under the src folder can be read in the above manner ,since post compilation they will be present in the folder build/classes.

How can I read the 'rampart.mar' file which is more of a runtime dependency jar?

Hope to hear from someone on this

Thank you!!


SCJP , SCWCD , SCBCD , SCDJWS
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
From a given class,



where the sourceLocation URL will be a url of the form jar://path/file.jar (if this class is inside a jar file)
or file://path/file.class if the class is in the build folder.

So after getting this url to where the current class is, you could do some strip off the last part of it to obtain the parent folder, maybe remove the file:// prefix with,
and then we can use it to do a new File(parentFolder, relativePathToMarFile) and pass that into axis2

Error: Keyboard not attached. Press F1 to continue.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Locating the path of a runtime dependency archive file
 
Similar Threads
Using CachedRowSet
Placing XML on the classpath
Rampart at the client side
Not able to read XML file from dependent project
Read Text File Using Relative Path.