int countRemoved = removeFiles(file, longLifeBefore, longLifeBefore, true); if (logger.isDebugEnabled()) int countRemoved = removeFiles(file, removeBefore, longLifeBefore, true); if (logger.isDebugEnabled())
int countRemoved = removeFiles(file, longLifeBefore, longLifeBefore, true); if (logger.isDebugEnabled()) int countRemoved = removeFiles(file, removeBefore, longLifeBefore, true); if (logger.isDebugEnabled())
int count = removeFiles(tempDir, aFewHoursBack, aLongTimeBack, false); // don't delete this directory
int count = removeFiles(tempDir, aFewHoursBack, aLongTimeBack, false); // don't delete this directory
/** * Ensures that the temp locations are cleaned out before the tests start */ @Override protected void setUp() throws Exception { // Grab a suitably configured context ctx = MiscContextTestSuite.getMinimalContext(); // Grab other useful beans serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); mimetypeService = serviceRegistry.getMimetypeService(); transformerDebug = (TransformerDebug) ctx.getBean("transformerDebug"); transformerConfig = (TransformerConfig) ctx.getBean("transformerConfig"); // perform a little cleaning up long now = System.currentTimeMillis(); TempFileProvider.TempFileCleanerJob.removeFiles(now); }
/** * Ensures that the temp locations are cleaned out before the tests start */ @Override public void setUp() throws Exception { // Grab the context, which will normally have been // cached by the ApplicationContextHelper ctx = MiscContextTestSuite.getMinimalContext(); this.mimetypeMap = (MimetypeMap) ctx.getBean("mimetypeService"); this.dictionaryService = (DictionaryService) ctx.getBean("dictionaryService"); // perform a little cleaning up long now = System.currentTimeMillis(); TempFileProvider.TempFileCleanerJob.removeFiles(now); TimeZone tz = TimeZone.getTimeZone("GMT"); TimeZone.setDefault(tz); // Joda time has already grabbed the JVM zone so re-set it here DateTimeZone.setDefault(DateTimeZone.forTimeZone(tz)); }
/** * Removes all temporary files created before the given time. * <p> * The delete will cascade down through directories as well. * * @param removeBefore only remove files created <b>before</b> this time * @return Returns the number of files removed */ public static int removeFiles(long removeBefore) { File tempDir = TempFileProvider.getTempDir(); return removeFiles(tempDir, removeBefore, removeBefore, false); }
/** * Removes all temporary files created before the given time. * <p> * The delete will cascade down through directories as well. * * @param removeBefore only remove files created <b>before</b> this time * @return Returns the number of files removed */ public static int removeFiles(long removeBefore) { File tempDir = TempFileProvider.getTempDir(); return removeFiles(tempDir, removeBefore, removeBefore, false); }