public static boolean deleteFile(String filePath) { return delete(new File(filePath), false); }
public static boolean deleteDirectory(String directoryPath) { File directory = new File(directoryPath); if (directory.isDirectory()) { if (directory.listFiles().length == 0) { return delete(directory, true); } } return false; }
protected void delete(final String storePath) { if (storePath != null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Deleting store " + storePath); } File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location " + storePath); } } _configFileName = null; _directoryName = null; } }
@Override protected void doDelete() { if (_storePath != null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Deleting preference store " + _storePath); } File preferenceStoreFile = new File(_storePath); if (!FileUtils.delete(preferenceStoreFile, true)) { LOGGER.info("Failed to delete the preference store at location " + _storePath); } } }
@Override public void onDelete(ConfiguredObject<?> parent) { FileBasedSettings fileBasedSettings = (FileBasedSettings)parent; String storePath = fileBasedSettings.getStorePath(); if (storePath != null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Deleting store " + storePath); } File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location " + storePath); } } }
@Override public void onDelete(ConfiguredObject parent) { if (isMessageStoreOpen()) { throw new IllegalStateException("Cannot delete the store as store is still open"); } FileBasedSettings fileBasedSettings = (FileBasedSettings)parent; String storePath = fileBasedSettings.getStorePath(); if (storePath != null) { LOGGER.debug("Deleting store : {}", storePath); File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location : {}", storePath); } } }
@Override public void onDelete(ConfiguredObject<?> parent) { if (_providedMessageStore.isMessageStoreOpen()) { throw new IllegalStateException("Cannot delete the store as the provided message store is still open"); } FileBasedSettings fileBasedSettings = (FileBasedSettings) parent; String storePath = fileBasedSettings.getStorePath(); if (!DerbyUtils.MEMORY_STORE_LOCATION.equals(storePath)) { if (storePath != null) { LOGGER.debug("Deleting store {}", storePath); File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location " + storePath); } } } }
@Override public void onDelete(ConfiguredObject<?> parent) { if (isMessageStoreOpen()) { throw new IllegalStateException("Cannot delete the store as store is still open"); } FileBasedSettings fileBasedSettings = (FileBasedSettings)parent; String storePath = fileBasedSettings.getStorePath(); if (storePath != null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Deleting store : {}", storePath); } File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location : {} ", storePath); } } }
success = delete(files[i], true) && success;