private static void delete() { for (final String path : delete) { delete(new File(path)); } }
} catch (final IOException e) { Files.delete(destinationDir); throw e;
private static void delete() { for (final String path : delete) { delete(new File(path)); } }
} catch (final IOException e) { Files.delete(destinationDir); throw e;
public static void delete(final File file) { if (file.exists()) { if (file.isDirectory()) { final File[] files = file.listFiles(); if (null != files) { for (final File f : files) { delete(f); } } } try { if (!file.delete()) { file.deleteOnExit(); } } catch (final Throwable e) { //Ignore } } }
private synchronized File copyBinaries(final Properties props) throws OpenEJBException { final File dump = ProvisioningUtil.cacheFile(props.getProperty(OPENEJB_PATH_BINARIES, "dump.war")); if (dump.exists()) { Files.delete(dump); final String name = dump.getName(); if (name.endsWith("ar") && name.length() > 4) { final File exploded = new File(dump.getParentFile(), name.substring(0, name.length() - 4)); if (exploded.exists()) { Files.delete(exploded); } } } try { IO.copy(byte[].class.cast(props.get(OPENEJB_VALUE_BINARIES)), dump); } catch (final IOException e) { throw new OpenEJBException(e); } return dump; }
private synchronized File copyBinaries(final Properties props) throws OpenEJBException { final File dump = ProvisioningResolver.cacheFile(props.getProperty(OPENEJB_PATH_BINARIES, "dump.war")); if (dump.exists()) { Files.delete(dump); final String name = dump.getName(); if (name.endsWith("ar") && name.length() > 4) { final File exploded = new File(dump.getParentFile(), name.substring(0, name.length() - 4)); if (exploded.exists()) { Files.delete(exploded); } } } try { IO.copy(byte[].class.cast(props.get(OPENEJB_VALUE_BINARIES)), dump); } catch (final IOException e) { throw new OpenEJBException(e); } return dump; }
/** * Delete a file and all contents if specified file is a directory. * If the delete fails then the file/s are flagged for delete on exit. * * @param file File */ public static void delete(final File file) { if (null != file && file.exists()) { if (file.isDirectory()) { final File[] files = file.listFiles(); if (null != files) { for (final File f : files) { delete(f); } } } try { hackJDK4715154(); if (!file.delete()) { file.deleteOnExit(); } } catch (final Throwable e) { //Ignore } } }
public void updateIfNecessary() throws IOException { File timestampFile = getTimestampFile(); boolean forceDelete = Boolean.getBoolean("tomee.runner.force-delete"); if (forceDelete || !timestampFile.exists() || isUpdateRequired()) { if (forceDelete || timestampFile.exists()) { System.out.println("Deleting " + distributionDirectory.getAbsolutePath()); Files.delete(distributionDirectory); } extractApplicationServer(); writeTimestamp(); } }
throw new IllegalStateException(e); } finally { Files.delete(zipFile);