@Test public void testUpload() { final JschSftpProcessor processor = mock(StubbedJschSftpProcessor.class); final FileRequest request = mock(FileRequest.class); new JschUploader(processor).upload(Arrays.asList(request)); verify(processor, times(1)).queueUpload(request, false, Uploader.GOD_PERMISSIONS); verify(processor, times(1)).upload(); }
@Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } }
JschUploader implements Uploader { @Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } } }
JschUploader implements Uploader { @Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } } JschUploader(final JschSftpProcessor processor); }
JschUploader implements Uploader { @Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } } JschUploader(final JschSftpProcessor processor); @Override void ignoreChmodErrors(final boolean ignoreChmodErrors); @Override void setPermissions(final int permissions); @Override void upload(final Collection<? extends FileRequest> requests); }
JschUploader implements Uploader { @Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } } JschUploader(final JschSftpProcessor processor); @Override void ignoreChmodErrors(final boolean ignoreChmodErrors); @Override void setPermissions(final int permissions); @Override void upload(final Collection<? extends FileRequest> requests);  }