### Question:
AVSwingUtil extends GpCoreUtil { public static File createLocalCopyFromURL(final Component owner, final URL url, String title, final String postFix) throws IOException { if (!url.toString().contains("jar:") && (url.toString().contains("file"))) { LOGGER.debug("Not copying the URL to temp file because we are local and not in a JAR."); return DataUtilities.urlToFile(url); } if (cachedLocalCopiedFiles.containsKey(url)) { File fileInTemp = cachedLocalCopiedFiles.get(url); if (fileInTemp.exists() && fileInTemp.length() > 0) { return fileInTemp; } else { cachedLocalCopiedFiles.remove(url); } } if (title == null) title = ""; final File localTempFile = File.createTempFile(ATLAS_TEMP_FILE_BASE_ID + IOUtil.cleanFilename(title), postFix); new AtlasSwingWorker<Void>(owner) { @Override protected Void doInBackground() throws Exception { FileUtils.copyURLToFile(url, localTempFile); localTempFile.deleteOnExit(); String msg = "downloaded to " + localTempFile; LOGGER.debug(msg); return null; } }.executeModalNoEx(); cachedLocalCopiedFiles.put(url, localTempFile.getCanonicalFile()); return localTempFile.getCanonicalFile(); }  static JColorChooser getJcolorChooser(); static Color showColorChooser(final Component component,
			final String title, final Color initialColor); final static void showMessageDialog(final Component owner,
			final String message); static boolean askOKCancel(final Component owner,
			final String question); static File createLocalCopyFromURL(final Component owner,
			final URL url, String title, final String postFix); static void copyHTMLInfoFiles(
			final AtlasStatusDialogInterface statusDialog, final File file,
			final AtlasConfig ac, final File targetDir, final Logger log); static Exception launchPDFViewer(final Component owner, URL url,
			String title); static void initEPSG(Component parent); static Exception lauchHTMLviewer(final Component owner, final URL url); static void lauchHTMLviewer(final Component owner, final URI uri); static Exception showImageAsHtmlPopup(final Component owner, final URL url, AtlasConfig ac); static File getLocalCopy(DpEntry<? extends ChartStyle> dpe,
			Component owner); static final URL getUrl(DpEntry<?> dpe, Component comp); static final URL getUrl(DpEntry dpe,
			AtlasStatusDialogInterface statusDialog); static void exportTo(DpEntry<? extends ChartStyle> dpe,
			File targetDir, Component owner); static File selectExportDir(Component owner, AtlasConfig atlasConfig); static Object runWaiting(Component owner,
			final RunnableFuture<Object> runnable); final static float HEADING_FONT_SIZE; }### Answer:
@Test public void testCreateLocalCopyFromURLRecoversIfTheFileIsDeleted() throws IOException { if (!TestingUtil.INTERACTIVE) return; URL url = new URL("http: assertNotNull(url); File file = AVSwingUtil .createLocalCopyFromURL(null, url, "test", "tif"); assertTrue(file.exists()); file.delete(); assertFalse(file.exists()); file = AVSwingUtil.createLocalCopyFromURL(null, url, "test", "tif"); assertTrue(file.exists()); }