Code example for File

Methods: mkdir, toString

0
	} 
 
	public static File unpack(File moduleResource, String moduleName, ModuleType modType) throws IOException { 
		/* create temp dir to unpack; assume no hash collision */ 
		String tmpDirName = moduleName + '-' + String.valueOf(counter++) + "-tmp"; 
		File result = new File(resourceDir, tmpDirName); 
		if(!result.isDirectory() && !result.mkdir()) 
			throw new IOException("Unable to create tmp directory to unpack: " + result.toString()); 
		 
		if(modType.unpacker != null) { 
			modType.unpacker.unpack(moduleResource, result); 
		} else { 
			Log.v(TAG, "ModuleUtils.unpack(): aborting (internal error)"); 
			result = null; 
		} 
		return result; 
	} 
 
	public static File getResource(URI httpUri, boolean download) throws IOException { 
		String cacheFilename = getResourceUriHash(httpUri.toString()); 
		File cachedFile = new File(resourceDir, cacheFilename);