@Test public void testUploadNothingQueued() { final Map<File, URI> uploadMap = cclUploader.upload(); assertThat(uploadMap).isNotNull(); assertThat(uploadMap).isEmpty(); verifyNoInteractions(uploader); verify(jetmMock).collect(); }
@Override public Map<File, URI> upload() { final EtmPoint point = PointFactory.getPoint(getClass(), "upload"); try { if (requestedFiles.isEmpty()) return Collections.<File, URI> emptyMap(); final Map<File, URI> uploads = new HashMap<File, URI>(requestedFiles.size()); final Set<FileRequest> uploadRequests = new HashSet<FileRequest>(requestedFiles.size()); for (final File requestedFile : requestedFiles) { final URI remotePath = FileAssistant.createRemotePath(requestedFile); uploadRequests.add(FileRequestFactory.create(requestedFile.toURI(), remotePath)); uploads.put(requestedFile, remotePath); } final Uploader uploader = SftpUploader.createUploader(AuthHelper.fromCurrentSubject()); uploader.ignoreChmodErrors(true); uploader.upload(uploadRequests); return uploads; } finally { point.collect(); } }
CclResourceUploaderImpl extends CclResourceUploader { @Override public Map<File, URI> upload() { final EtmPoint point = PointFactory.getPoint(getClass(), "upload"); try { if (requestedFiles.isEmpty()) return Collections.<File, URI> emptyMap(); final Map<File, URI> uploads = new HashMap<File, URI>(requestedFiles.size()); final Set<FileRequest> uploadRequests = new HashSet<FileRequest>(requestedFiles.size()); for (final File requestedFile : requestedFiles) { final URI remotePath = FileAssistant.createRemotePath(requestedFile); uploadRequests.add(FileRequestFactory.create(requestedFile.toURI(), remotePath)); uploads.put(requestedFile, remotePath); } final Uploader uploader = SftpUploader.createUploader(AuthHelper.fromCurrentSubject()); uploader.ignoreChmodErrors(true); uploader.upload(uploadRequests); return uploads; } finally { point.collect(); } } }
CclResourceUploaderImpl extends CclResourceUploader { @Override public Map<File, URI> upload() { final EtmPoint point = PointFactory.getPoint(getClass(), "upload"); try { if (requestedFiles.isEmpty()) return Collections.<File, URI> emptyMap(); final Map<File, URI> uploads = new HashMap<File, URI>(requestedFiles.size()); final Set<FileRequest> uploadRequests = new HashSet<FileRequest>(requestedFiles.size()); for (final File requestedFile : requestedFiles) { final URI remotePath = FileAssistant.createRemotePath(requestedFile); uploadRequests.add(FileRequestFactory.create(requestedFile.toURI(), remotePath)); uploads.put(requestedFile, remotePath); } final Uploader uploader = SftpUploader.createUploader(AuthHelper.fromCurrentSubject()); uploader.ignoreChmodErrors(true); uploader.upload(uploadRequests); return uploads; } finally { point.collect(); } }  }
CclResourceUploaderImpl extends CclResourceUploader { @Override public Map<File, URI> upload() { final EtmPoint point = PointFactory.getPoint(getClass(), "upload"); try { if (requestedFiles.isEmpty()) return Collections.<File, URI> emptyMap(); final Map<File, URI> uploads = new HashMap<File, URI>(requestedFiles.size()); final Set<FileRequest> uploadRequests = new HashSet<FileRequest>(requestedFiles.size()); for (final File requestedFile : requestedFiles) { final URI remotePath = FileAssistant.createRemotePath(requestedFile); uploadRequests.add(FileRequestFactory.create(requestedFile.toURI(), remotePath)); uploads.put(requestedFile, remotePath); } final Uploader uploader = SftpUploader.createUploader(AuthHelper.fromCurrentSubject()); uploader.ignoreChmodErrors(true); uploader.upload(uploadRequests); return uploads; } finally { point.collect(); } }  @Override void queueUpload(final File file); @Override Map<File, URI> upload(); }
CclResourceUploaderImpl extends CclResourceUploader { @Override public Map<File, URI> upload() { final EtmPoint point = PointFactory.getPoint(getClass(), "upload"); try { if (requestedFiles.isEmpty()) return Collections.<File, URI> emptyMap(); final Map<File, URI> uploads = new HashMap<File, URI>(requestedFiles.size()); final Set<FileRequest> uploadRequests = new HashSet<FileRequest>(requestedFiles.size()); for (final File requestedFile : requestedFiles) { final URI remotePath = FileAssistant.createRemotePath(requestedFile); uploadRequests.add(FileRequestFactory.create(requestedFile.toURI(), remotePath)); uploads.put(requestedFile, remotePath); } final Uploader uploader = SftpUploader.createUploader(AuthHelper.fromCurrentSubject()); uploader.ignoreChmodErrors(true); uploader.upload(uploadRequests); return uploads; } finally { point.collect(); } }  @Override void queueUpload(final File file); @Override Map<File, URI> upload();  }