@Test public void testFind() { final Host host = new Host(new TestProtocol()); assertNull(host.getDownloadFolder()); final UploadDirectoryFinder finder = new UploadDirectoryFinder(); assertEquals(new Local(System.getProperty("user.home")), finder.find(host)); }
@Override public Local find(final Host bookmark) { if(null != bookmark.getUploadFolder()) { if(bookmark.getUploadFolder().exists()) { return bookmark.getUploadFolder(); } } final Local directory = LocalFactory.get(preferences.getProperty("local.user.home")); if(log.isInfoEnabled()) { log.info(String.format("Suggest default upload folder %s for bookmark %s", directory, bookmark)); } return directory; }
UploadDirectoryFinder implements DirectoryFinder { @Override public Local find(final Host bookmark) { if(null != bookmark.getUploadFolder()) { if(bookmark.getUploadFolder().exists()) { return bookmark.getUploadFolder(); } } final Local directory = LocalFactory.get(preferences.getProperty("local.user.home")); if(log.isInfoEnabled()) { log.info(String.format("Suggest default upload folder %s for bookmark %s", directory, bookmark)); } return directory; } }
UploadDirectoryFinder implements DirectoryFinder { @Override public Local find(final Host bookmark) { if(null != bookmark.getUploadFolder()) { if(bookmark.getUploadFolder().exists()) { return bookmark.getUploadFolder(); } } final Local directory = LocalFactory.get(preferences.getProperty("local.user.home")); if(log.isInfoEnabled()) { log.info(String.format("Suggest default upload folder %s for bookmark %s", directory, bookmark)); } return directory; }  }
UploadDirectoryFinder implements DirectoryFinder { @Override public Local find(final Host bookmark) { if(null != bookmark.getUploadFolder()) { if(bookmark.getUploadFolder().exists()) { return bookmark.getUploadFolder(); } } final Local directory = LocalFactory.get(preferences.getProperty("local.user.home")); if(log.isInfoEnabled()) { log.info(String.format("Suggest default upload folder %s for bookmark %s", directory, bookmark)); } return directory; }  @Override Local find(final Host bookmark); @Override void save(final Host bookmark, final Local directory); }
UploadDirectoryFinder implements DirectoryFinder { @Override public Local find(final Host bookmark) { if(null != bookmark.getUploadFolder()) { if(bookmark.getUploadFolder().exists()) { return bookmark.getUploadFolder(); } } final Local directory = LocalFactory.get(preferences.getProperty("local.user.home")); if(log.isInfoEnabled()) { log.info(String.format("Suggest default upload folder %s for bookmark %s", directory, bookmark)); } return directory; }  @Override Local find(final Host bookmark); @Override void save(final Host bookmark, final Local directory);  }