@Nonnull private static FileIOError _deleteUDO (@Nonnull final TemporaryUserDataObject aUDO) { LOGGER.info ("Deleting uploaded file " + aUDO); final FileIOError aError = FileOperationManager.INSTANCE.deleteFile (aUDO.getAsFile ()); if (aError.isFailure ()) LOGGER.error ("Failed to delete UDO " + aUDO.getPath () + ": " + aError.getErrorCode ()); return aError; }
if (aParentDir != null) final FileIOError aError = FileOperationManager.INSTANCE.createDirRecursiveIfNotExisting (aParentDir); if (aError.isFailure ()) throw new DAOException ("The DAO of class " +
/** * closeAll - closes the input stream, and deletes the backing file * * @throws IOException * in case of error */ public void closeAll () throws IOException { try { m_aSrcIS.close (); super.close (); } finally { FileOperationManager.INSTANCE.deleteFileIfExisting (m_aTempFile); } }
@Override public void before () { m_bOldDAOSilentMode = AbstractDAO.setSilentMode (true); m_bOldWebFileIOSilentMode = WebFileIO.setSilentMode (true); m_bOldSCCtxHolderSilentMode = ServletContextPathHolder.setSilentMode (true); super.before (); m_aCleansingRules = PhotonBasicTestInit.init (m_aDataPath, m_sServletContextPath); if (m_bDeleteAllData) { // Clean all contained files FileOperationManager.INSTANCE.deleteDirRecursiveIfExisting (WebFileIO.getDataIO ().getBasePathFile ()); FileOperationManager.INSTANCE.createDir (WebFileIO.getDataIO ().getBasePathFile ()); } }
/** * This method is called if recovery from the WAL file (partially) failed an * analysis might be needed. */ final void _maintainWALFileAfterProcessing (@Nonnull @Nonempty final String sWALFilename) { ValueEnforcer.notEmpty (sWALFilename, "WALFilename"); final File aWALFile = m_aIO.getFile (sWALFilename); final File aNewFile = new File (aWALFile.getParentFile (), aWALFile.getName () + "." + PDTFactory.getCurrentMillis () + ".bup"); if (FileOperationManager.INSTANCE.renameFile (aWALFile, aNewFile).isFailure ()) { if (LOGGER.isErrorEnabled ()) LOGGER.error ("Failed to rename WAL file '" + aWALFile.getAbsolutePath () + "' to '" + aNewFile.getAbsolutePath () + "'"); } else { if (LOGGER.isInfoEnabled ()) LOGGER.info ("Maintained WAL file '" + aWALFile.getAbsolutePath () + "' as '" + aNewFile.getAbsolutePath () + "' for debugging purposes"); } }
/** * This method may only be triggered with valid WAL filenames, as the passed * file is deleted! */ final void _deleteWALFileAfterProcessing (@Nonnull @Nonempty final String sWALFilename) { ValueEnforcer.notEmpty (sWALFilename, "WALFilename"); final File aWALFile = m_aIO.getFile (sWALFilename); if (FileOperationManager.INSTANCE.deleteFile (aWALFile).isFailure ()) { if (LOGGER.isErrorEnabled ()) LOGGER.error ("Failed to delete WAL file '" + aWALFile.getAbsolutePath () + "'"); } else { if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info ("Deleted successfully imported WAL file '" + aWALFile.getAbsolutePath () + "'"); } }
if (aParentDir != null) final FileIOError aError = FileOperationManager.INSTANCE.createDirRecursiveIfNotExisting (aParentDir); if (aError.isFailure ()) throw new DAOException ("The DAO of class " +
FileOperationManager.INSTANCE.deleteFile (m_aIndexerWorkItemFile);
for (final File aFile : new FileSystemIterator (aDir)) if (!containsResourceBundleOfID (aFile.getName ())) if (FileOperationManager.INSTANCE.deleteFile (aFile).isSuccess ()) LOGGER.info ("Successfully deleted the unused resource bundle file " + aFile.getAbsolutePath ());