java - How to iterate through each xml file in root of a jar -


during runtime of app need iterate through each xml file lies in root of jar.

i know can access concrete file this

inputstream in = this.getclass().getclassloader().getresourceasstream( "filename.xml" ); 

but how can receive list of files in root of jar?

thanks

try this.

java: listing contents of resource directory
the classloader.getresource() function can handy way load files in java. files can loaded folder or jar file on classpath. however, api disappointingly lacks way list files in directory. (no, getresources() not it.) utility function comes rescue!


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -