my dog learned polymorphism
The moose likes Java in General and the fly likes Newbie Help with JAR file containing XML files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Newbie Help with JAR file containing XML files" Watch "Newbie Help with JAR file containing XML files" New topic

Newbie Help with JAR file containing XML files

John Harris

Joined: Oct 20, 2005
Posts: 7
Hi, I'm trying to modify an existing application which curently reads in XML validation files using the following code (path being passed in is "/WEB-INF/classes/com/oneaccount/ofm/validation/rules/"):

public static void initialise(ServletContext sc, String path) {
// intitalise the HaspMap of reource names
resources = new HashMap();

// store the original path
rootPath = path;

// start the load sequence
loadNames(path, sc);

public static void loadNames(String path, ServletContext sc){

// record the directory name removing slashes with full stops
currentDir = getPathAsDotNotation(path, rootPath);

// load the current resources
Set resourceSet = sc.getResourcePaths(path);
Iterator iter = resourceSet.iterator();
String resourceName = (String);
if(resourceName.substring(resourceName.length() - 1).equals("/")){
// found a directory

// remember this directory name
String dirForStepDown = currentDir;

// recursive call
loadNames(resourceName, sc);

// restore previous directory name
currentDir = dirForStepDown;
// found a file

The intention in the future is to JAR up the XML files (whilst preserving the existing directory structure). I've tried numerous ways of trying to access the newly created JAR file (which is in the bin directory) but not had any success so far. Can anyone suggest any solutions. Thanks in advance.
I agree. Here's the link:
subject: Newbie Help with JAR file containing XML files
It's not a secret anymore!