public void extract(Class<?> markerClass, String bundlePath,
			String[] source, String[] dest) throws MalformedURLException,
			IOException {
		File tempFolder = File.createTempFile("unpack", "bundles");

		tempFolder.delete();
		if (!tempFolder.mkdir()) {
			throw new IOException(
					"Unable to create working space at "
							+ tempFolder.getAbsolutePath()
							+ " (deleted a temp file but failed to recreate it as a directory, " +
									"please report at https://github.com/ieb/sparsemapcontent )");
		}
		try {
			List<File> unpackedBundles = unpackJarContents(
					getContainingJarFile(markerClass),
					new String[] { bundlePath },
					new String[] { tempFolder.getAbsolutePath() });
			for (File f : unpackedBundles) {
				try {
					unpackJarContents(f, source, dest);
				} catch (IOException e) {
					logger.info("Failed to Unpack " + f.getName(), e);
				}
			}
		} finally {
			deleteAll(tempFolder);
		}
	}
public void extract ( Class < ? > markerClass , String bundlePath , String [ ] source , String [ ] dest ) throws MalformedURLException , IOException { File tempFolder = File . createTempFile ( "unpack" , "bundles" ) ; tempFolder . delete ( ) ; if ( ! tempFolder . mkdir ( ) ) { throw new IOException ( "Unable to create working space at " + tempFolder . getAbsolutePath ( ) + " (deleted a temp file but failed to recreate it as a directory, " + "please report at https://github.com/ieb/sparsemapcontent )" ) ; } try { List < File > unpackedBundles = unpackJarContents ( getContainingJarFile ( markerClass ) , new String [ ] { bundlePath } , new String [ ] { tempFolder . getAbsolutePath ( ) } ) ; for ( File f : unpackedBundles ) { try { unpackJarContents ( f , source , dest ) ; } catch ( IOException e ) { logger . info ( "Failed to Unpack " + f . getName ( ) , e ) ; } } } finally { deleteAll ( tempFolder ) ; } }
@param markerClass
a class to identify the jar in which the content is to be
loaded from, normally the bootstrap jar.
@param bundlePath
the path in the jar where OSGi bundles are contained.
@param strings
the path within the OSGi bundle where static content is
located.
@param strings2
the folder where that content will be unpacked.
@throws MalformedURLException
if the classpath element containing the marker class is not a
jar.
@throws IOException
if the bootstrap jar file can't be opened.