MultipartObjectAssembler { public synchronized MultipartManifest newRequest( String contentType, String contentLanguage, String contentEncoding, Map<String, String> opcMeta) { checkInitialized(); String ifNoneMatch = ObjectStorageUtils.getIfNoneMatchHeader(allowOverwrite); CreateMultipartUploadResponse createUploadResponse = service.createMultipartUpload( CreateMultipartUploadRequest.builder() .invocationCallback(invocationCallback) .bucketName(bucketName) .ifNoneMatch(ifNoneMatch) .namespaceName(namespaceName) .createMultipartUploadDetails( CreateMultipartUploadDetails.builder() .object(objectName) .contentEncoding(contentEncoding) .contentLanguage(contentLanguage) .contentType(contentType) .metadata(opcMeta) .build()) .opcClientRequestId(createClientRequestId("-create")) .build()); this.manifest = new MultipartManifestImpl(createUploadResponse.getMultipartUpload().getUploadId()); this.transferManager = new MultipartTransferManager(executorService, this.manifest, service); this.initialized = true; return this.manifest; } @Deprecated  MultipartObjectAssembler(
            ObjectStorage service,
            String namespaceName,
            String bucketName,
            String objectName,
            boolean allowOverwrite,
            ExecutorService executorService); @Builder private  MultipartObjectAssembler(
            ObjectStorage service,
            String namespaceName,
            String bucketName,
            String objectName,
            boolean allowOverwrite,
            ExecutorService executorService,
            String opcClientRequestId,
            Consumer<Invocation.Builder> invocationCallback,
            RetryConfiguration retryConfiguration); synchronized MultipartManifest newRequest(
            String contentType,
            String contentLanguage,
            String contentEncoding,
            Map<String, String> opcMeta); synchronized MultipartManifest resumeRequest(String uploadId); int addPart(File file, String md5); int addPart(InputStream stream, long contentLength, String md5); void setPart(File file, String md5, int partNum); void setPart(InputStream stream, long contentLength, String md5, int partNum); AbortMultipartUploadResponse abort(); CommitMultipartUploadResponse commit();  }
@Test public void newRequest_andVerifyManifestWithRetryConfiguration() { String uploadId = "uploadId"; initializeCreateMultipartUpload(uploadId); MultipartManifest manifest = assemblerWithRetryConfiguration.newRequest( CONTENT_TYPE, CONTENT_LANGUAGE, CONTENT_ENCODING, OPC_META); assertNotNull(manifest); assertEquals(uploadId, manifest.getUploadId()); ArgumentCaptor<CreateMultipartUploadRequest> captor = ArgumentCaptor.forClass(CreateMultipartUploadRequest.class); verify(service).createMultipartUpload(captor.capture()); CreateMultipartUploadRequest request = captor.getValue(); assertEquals(NAMESPACE, request.getNamespaceName()); assertEquals(BUCKET, request.getBucketName()); assertEquals(OBJECT, request.getCreateMultipartUploadDetails().getObject()); assertEquals(CONTENT_TYPE, request.getCreateMultipartUploadDetails().getContentType()); assertEquals( CONTENT_LANGUAGE, request.getCreateMultipartUploadDetails().getContentLanguage()); assertEquals( CONTENT_ENCODING, request.getCreateMultipartUploadDetails().getContentEncoding()); assertEquals(OPC_META, request.getCreateMultipartUploadDetails().getMetadata()); assertEquals(mockInvocationCallback, request.getInvocationCallback()); }
@Test public void newRequest_andVerifyManifest() { String uploadId = "uploadId"; initializeCreateMultipartUpload(uploadId); MultipartManifest manifest = assembler.newRequest(CONTENT_TYPE, CONTENT_LANGUAGE, CONTENT_ENCODING, OPC_META); assertNotNull(manifest); assertEquals(uploadId, manifest.getUploadId()); ArgumentCaptor<CreateMultipartUploadRequest> captor = ArgumentCaptor.forClass(CreateMultipartUploadRequest.class); verify(service).createMultipartUpload(captor.capture()); CreateMultipartUploadRequest request = captor.getValue(); assertEquals(NAMESPACE, request.getNamespaceName()); assertEquals(BUCKET, request.getBucketName()); assertEquals(OBJECT, request.getCreateMultipartUploadDetails().getObject()); assertEquals(CONTENT_TYPE, request.getCreateMultipartUploadDetails().getContentType()); assertEquals( CONTENT_LANGUAGE, request.getCreateMultipartUploadDetails().getContentLanguage()); assertEquals( CONTENT_ENCODING, request.getCreateMultipartUploadDetails().getContentEncoding()); assertEquals(OPC_META, request.getCreateMultipartUploadDetails().getMetadata()); assertEquals(mockInvocationCallback, request.getInvocationCallback()); }