• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Locating the path of a runtime dependency archive file

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic