protected void extractBundleContent ( String bundleRootPath , String toDirRoot ) throws IOException { File toDir = new File ( toDirRoot ) ; if ( ! toDir . isDirectory ( ) ) { throw new RuntimeException ( "[" + toDir . getAbsolutePath ( ) + "] is not a valid directory or does not exist!" ) ; } toDir = new File ( toDir , bundle . getSymbolicName ( ) ) ; toDir = new File ( toDir , bundle . getVersion ( ) . toString ( ) ) ; FileUtils . forceMkdir ( toDir ) ; bundleExtractDir = toDir ; Enumeration < String > entryPaths = bundle . getEntryPaths ( bundleRootPath ) ; if ( entryPaths != null ) { while ( entryPaths . hasMoreElements ( ) ) { extractContent ( bundleRootPath , entryPaths . nextElement ( ) , bundleExtractDir ) ; } } }
Extracts content from the bundle to a directory .