@Test public void createsLocalDirIfNotExisting() throws Exception { Path newDir = tmpDir.resolve("subdir"); config.setLocalPath(newDir); syncer.run(); waitUntil(() -> Files.isDirectory(newDir)); }
@Override public void run() { try { executor = Executors.newFixedThreadPool(10); ensureLocalDir(); index = config.getSyncIndex(); startWatcher(); nav = navigateToRemoteDir(); registerRemoteChangeHandler(nav); registerRemotePoller(); notifyAllContents(nav, remoteChangeHandler); } catch (QblStorageException | IOException e) { logger.error("failed to start sync: " + e.getMessage(), e); } }
DefaultSyncer implements Syncer { @Override public void run() { try { executor = Executors.newFixedThreadPool(10); ensureLocalDir(); index = config.getSyncIndex(); startWatcher(); nav = navigateToRemoteDir(); registerRemoteChangeHandler(nav); registerRemotePoller(); notifyAllContents(nav, remoteChangeHandler); } catch (QblStorageException | IOException e) { logger.error("failed to start sync: " + e.getMessage(), e); } } }
DefaultSyncer implements Syncer { @Override public void run() { try { executor = Executors.newFixedThreadPool(10); ensureLocalDir(); index = config.getSyncIndex(); startWatcher(); nav = navigateToRemoteDir(); registerRemoteChangeHandler(nav); registerRemotePoller(); notifyAllContents(nav, remoteChangeHandler); } catch (QblStorageException | IOException e) { logger.error("failed to start sync: " + e.getMessage(), e); } } DefaultSyncer(BoxSyncConfig config, BoxVolume boxVolume, TransferManager manager); }
DefaultSyncer implements Syncer { @Override public void run() { try { executor = Executors.newFixedThreadPool(10); ensureLocalDir(); index = config.getSyncIndex(); startWatcher(); nav = navigateToRemoteDir(); registerRemoteChangeHandler(nav); registerRemotePoller(); notifyAllContents(nav, remoteChangeHandler); } catch (QblStorageException | IOException e) { logger.error("failed to start sync: " + e.getMessage(), e); } } DefaultSyncer(BoxSyncConfig config, BoxVolume boxVolume, TransferManager manager); void setLocalBlacklist(Blacklist blacklist); @Override List<Transaction> getHistory(); @Override void run(); static void notifyAllContents(BoxNavigation navigation, Observer remoteChangeHandler); boolean isProcessingLocalEvents(); @Override void shutdown(); void join(); @Override void setPollInterval(int amount, TimeUnit unit); @Override void stop(); boolean isPolling(); void waitFor(); BoxSyncBasedUploadFactory getUploadFactory(); void setUploadFactory(BoxSyncBasedUploadFactory uploadFactory); @Override boolean isSynced(); @Override double getProgress(); @Override DefaultSyncer onProgress(Runnable runnable); @Override long totalSize(); @Override long currentSize(); @Override int countFiles(); @Override int countFolders(); @Override boolean hasError(); @Override DefaultSyncer onProgress(Consumer<Transaction> consumer); @Override long totalElements(); @Override long finishedElements(); }
DefaultSyncer implements Syncer { @Override public void run() { try { executor = Executors.newFixedThreadPool(10); ensureLocalDir(); index = config.getSyncIndex(); startWatcher(); nav = navigateToRemoteDir(); registerRemoteChangeHandler(nav); registerRemotePoller(); notifyAllContents(nav, remoteChangeHandler); } catch (QblStorageException | IOException e) { logger.error("failed to start sync: " + e.getMessage(), e); } } DefaultSyncer(BoxSyncConfig config, BoxVolume boxVolume, TransferManager manager); void setLocalBlacklist(Blacklist blacklist); @Override List<Transaction> getHistory(); @Override void run(); static void notifyAllContents(BoxNavigation navigation, Observer remoteChangeHandler); boolean isProcessingLocalEvents(); @Override void shutdown(); void join(); @Override void setPollInterval(int amount, TimeUnit unit); @Override void stop(); boolean isPolling(); void waitFor(); BoxSyncBasedUploadFactory getUploadFactory(); void setUploadFactory(BoxSyncBasedUploadFactory uploadFactory); @Override boolean isSynced(); @Override double getProgress(); @Override DefaultSyncer onProgress(Runnable runnable); @Override long totalSize(); @Override long currentSize(); @Override int countFiles(); @Override int countFolders(); @Override boolean hasError(); @Override DefaultSyncer onProgress(Consumer<Transaction> consumer); @Override long totalElements(); @Override long finishedElements(); static final long ASSUMED_DIRECTORY_METADATA_SIZE; }