I have a Jar file that I created using a third-party library. When I packed the jar file, I include several XML files in it in a folder called data strong>
data - file1.xml - file2.xml - file3.xml
Now I wanted to read the folder inside the jar file and according to the documentation of the third-party library I could get the class loader and read the folder as input stream like this.
ClassLoader clsLoader = myService.getClassLoader(); InputStream accountsStream = clsLoader.getResourceAsStream("data");
The question is, how can I list all the files from the input stream and parse it one by one?
thanks
EDIT Added information:
How do I access resources that I put into my service or module archive file?
http://axis.apache.org/axis2/java/core/faq.html#b1
Sorry, the question was supposed to be specific to Apache Axis, but I'm a little confused if this is also a specific Java question.
After entering the input stream into a folder using the class loader, how can I list all the files in this folder and read them one at a time?
The steps in my code will be hidden.
- Get input stream to folder
- List all files from this input stream
- Read it one by one.
source share