Results 1 to 1 of 1
- 02-15-2013, 07:04 PM #1Member
- Join Date
- Feb 2013
- Rep Power
Read files from a folder challenge to support 2 "modes".
I have this application that needs to iterate thru a "resource" folder to look at all the XML (config) files inside and use that for something...
My problem is that I like to deploy the application using Java Web Start which means that I need to packaged this folder into the JAR file; and so iterate thru the folder withing a jar files will likely require the use of ClassLoader... However, when I am making enhancements/changes on my PC with Eclipse, the folder is not in a jar... Does anyone has a best practice (or prefer approach) for this:
1. Do I hardcode my code so that I implement 2 methods (one for handling the application when it is deployed in a jar and one for when it is being run from an IDE)?
2. Is there a setting in Eclipse such that it will run/debug after packaging everything as a jar first?
3. Are there Java code that can handle (take care) the situation that the resource is in a jar OR in a local file system?
- By klspepper in forum New To JavaReplies: 0Last Post: 12-07-2012, 09:29 AM
- By Googol in forum New To JavaReplies: 3Last Post: 10-30-2012, 04:06 PM
- By NeuroFuzzy in forum New To JavaReplies: 1Last Post: 02-04-2011, 10:36 PM
- By edelric666 in forum New To JavaReplies: 8Last Post: 11-05-2010, 12:03 AM
- By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 08:35 AM