@Test public void createsRootDirectory() throws QblStorageException { upload.source = tmpPath("/syncRoot"); upload.destination = syncRoot; upload.source.toFile().mkdirs(); upload.isDir = true; manager.upload(upload); List<BoxFolder> folders = nav().listFolders(); assertEquals(1, folders.size()); assertEquals("syncRoot", folders.get(0).getName()); }
void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } }
DefaultTransferManager extends Observable implements TransferManager { void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } } }
DefaultTransferManager extends Observable implements TransferManager { void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } }  }
DefaultTransferManager extends Observable implements TransferManager { void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } }  @Override List<Transaction> getTransactions(); @Override void addDownload(Download download); @Override List<Transaction> getHistory(); @Override void cleanup(); @Override void addUpload(Upload upload); @Override void run(); void next(); }
DefaultTransferManager extends Observable implements TransferManager { void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } }  @Override List<Transaction> getTransactions(); @Override void addDownload(Download download); @Override List<Transaction> getHistory(); @Override void cleanup(); @Override void addUpload(Upload upload); @Override void run(); void next();  }