final File tempDir = new File(baseDir, System.currentTimeMillis() + ".dir");
if (!tempDir.mkdir()) {
throw new IllegalStateException("Failed to create temporary directory");
}
tempDir.deleteOnExit();
final Expand expander = new Expand();
expander.setDest(tempDir);
expander.setSrc(new File(uri));
expander.execute();
final File dir = new File(tempDir, resourcePath);
if ( dir.exists() && dir.isDirectory() ) {
return dir;
}