@Test public void testRemoveFile() throws Exception { File passwordFile = new File(applicationDirectories.getWorkDirectory(), "admin.password"); Files.write(passwordFile.toPath(), "testpass".getBytes("UTF-8")); underTest.removeFile(); assertThat(passwordFile.exists(), is(false)); }
@Override public void removeFile() { if (adminPasswordFile.exists() && !adminPasswordFile.delete()) { log.error("Failed to delete admin.password file {}", adminPasswordFile); } }
AdminPasswordFileManagerImpl extends ComponentSupport implements AdminPasswordFileManager { @Override public void removeFile() { if (adminPasswordFile.exists() && !adminPasswordFile.delete()) { log.error("Failed to delete admin.password file {}", adminPasswordFile); } } }
AdminPasswordFileManagerImpl extends ComponentSupport implements AdminPasswordFileManager { @Override public void removeFile() { if (adminPasswordFile.exists() && !adminPasswordFile.delete()) { log.error("Failed to delete admin.password file {}", adminPasswordFile); } } @Inject  AdminPasswordFileManagerImpl(final ApplicationDirectories applicationDirectories); }
AdminPasswordFileManagerImpl extends ComponentSupport implements AdminPasswordFileManager { @Override public void removeFile() { if (adminPasswordFile.exists() && !adminPasswordFile.delete()) { log.error("Failed to delete admin.password file {}", adminPasswordFile); } } @Inject  AdminPasswordFileManagerImpl(final ApplicationDirectories applicationDirectories); @Override boolean writeFile(String password); @Override boolean exists(); @Override String getPath(); @Override String readFile(); @Override void removeFile(); }
AdminPasswordFileManagerImpl extends ComponentSupport implements AdminPasswordFileManager { @Override public void removeFile() { if (adminPasswordFile.exists() && !adminPasswordFile.delete()) { log.error("Failed to delete admin.password file {}", adminPasswordFile); } } @Inject  AdminPasswordFileManagerImpl(final ApplicationDirectories applicationDirectories); @Override boolean writeFile(String password); @Override boolean exists(); @Override String getPath(); @Override String readFile(); @Override void removeFile(); final ApplicationDirectories applicationDirectories; }