private File copyResource ( final File resource , final String resourceLocation ) throws ResourceDownloadError { final String tmpPath = asPath ( getSystemConfiguration ( ) . getCacheDirectory ( ) . getAbsolutePath ( ) , ResourceType . TMP_FILE . getResourceFolderName ( ) ) ; final String uuidDirName = UUID . randomUUID ( ) . toString ( ) ; // load copy file and create parent directories final File copyFile = new File ( asPath ( tmpPath , uuidDirName , resource . getName ( ) ) ) ; // copy to temp directory File resourceCopy = copyToDirectory ( resource , resourceLocation , copyFile ) ; // hash uuid temp directory for cleanup later tempResources . add ( new File ( asPath ( tmpPath , uuidDirName ) ) ) ; return resourceCopy ; }
Copy the resource to the system s temporary resources .