I am writing test cases that have to be executed in osgi environment, i have put the test data which is a set of files in the test bundle. I am able to access the test data files using bundle.getResource which returns an URL from which i can get the InputStream for a particular file, but how can i find out all the list of files in a particular folder in the test plugin. In eclispe i could use fileLocator to do this.
/bundle
testdata
one.txt
two.txt
three.txt
folder1
file1.txt
file2.txt
In the above bundle i want to find all the files and folders that are present in the testdata folder.
Best Reards,
Keshav
How does OSGi work? OSGi is a set of specifications that define a dynamic component system for Java. These specifications allow for a development model in which an application is composed of several components, and then packed into bundles. These components communicate locally and through the network via services.
The OSGi (Open Service Gateway Initiative) specification is a Java framework for developing and deploying modular software programs and libraries.
OSGi is a fast framework because it knows that which service will be loaded into OSGi environment thanks to pre-defined xml file. It reduces runtime cost thanks to lazy state. Service instance is created when they needed. Some bundle's different version can be used by other bundle at the same time.
If you know what bundle the information is in, use Bundle.findEntries or Bundle.getEntryPaths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With