Results 1 to 4 of 4
- 05-18-2009, 01:50 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 12
- Rep Power
- 0
loading files contained within app jar file
Hi all,
I'm writing an application that needs to load certain files based on a parameter passed into it.
This works fine when testing locally as i just build the uri based on that parameter (eg. "c:/workspace/PARAMETER/allfiles/") and load all files in that location.
However now i need to deploy the app as a jar file file on a jboss server and am unsure whether i can manipulate the file structure within a jar to achieve the same thing?
(For anybody interested the files are Drools drl files and each 'list' represents a different rulebase, theoretically there will be unlimited rulebases)
So can anybody advise me on the best approach to loading a specific list of files within a jar based on a passed in parameter?
Thanking you
- 05-18-2009, 02:01 PM #2
Use a variety of getResource...() method to load things from the classpath. (preferred)
Manipulate jars directly using java.util.jar package.Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 05-18-2009, 02:20 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 12
- Rep Power
- 0
regarding loading from the classpath - does this just load from the location that the .class object exist in?
- 05-18-2009, 02:26 PM #4
Info on classpath
When running from jars, there will be at least one ClassLoader that can search from the root of the jar. Most of the time the system class loader will do the job.Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
Similar Threads
-
loading a text file
By nick2price in forum New To JavaReplies: 2Last Post: 12-24-2008, 12:46 AM -
loading flash files in linux
By rajeshang in forum AWT / SwingReplies: 0Last Post: 05-31-2008, 01:59 PM -
External JavaScript files not loading
By sajut in forum New To JavaReplies: 0Last Post: 02-15-2008, 05:47 AM -
Loading of JSP file failed
By Heather in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 08-06-2007, 01:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks