SyncConfigurationManagerImpl implements SyncConfigurationManager { @Override public void purgeWorkDirectory() { try { FileUtils.cleanDirectory(SyncUIConfig.getWorkDir()); } catch (IOException e) { log.error("Unable to clean work directory due to: " + e.getMessage()); } } SyncConfigurationManagerImpl(); @Override void persistDuracloudConfiguration(String username,
                                              String password,
                                              String host,
                                              String port,
                                              String spaceId); @Override DuracloudConfiguration retrieveDuracloudConfiguration(); @Override DirectoryConfigs retrieveDirectoryConfigs(); @Override void persistDirectoryConfigs(DirectoryConfigs configs); @Override boolean isConfigurationComplete(); @Override void setConfigXmlPath(String configXml); @Override void persist(); @Override File getWorkDirectory(); @Override void purgeWorkDirectory(); @Override boolean isSyncDeletes(); @Override void setSyncDeletes(boolean flag); @Override String getUpdateSuffix(); @Override void setSyncUpdates(boolean b); @Override boolean isSyncUpdates(); @Override void setRenameUpdates(boolean b); @Override boolean isRenameUpdates(); @Override String getPrefix(); @Override void setPrefix(String prefix); @Override int getThreadCount(); @Override void setThreadCount(int threadCount); @Override void setJumpStart(boolean jumpStart); @Override boolean isJumpStart(); @Override RunMode getMode(); @Override void setMode(RunMode mode); @Override void setMaxFileSizeInBytes(long maxFileSize); @Override long getMaxFileSizeInBytes();  }
@Test public void testPurgeWorkDirectory() { File workDir = this.syncConfigurationManager.getWorkDirectory(); if (workDir != null) { if (!workDir.exists()) { workDir.mkdirs(); } if (workDir.list().length == 0) { new File(workDir, "test" + System.currentTimeMillis()).mkdir(); } } this.syncConfigurationManager.purgeWorkDirectory(); if (workDir != null) { assertTrue(workDir.list().length == 0); } }