private JerseyRequest<ClientFile> prepareUploadFileRequest() { JerseyRequest<ClientFile> request = buildRequest(sessionStorage, ClientFile.class, new String[] {"/resources", resourceUri}); request.addParams(params); request.setContentType(MediaType.MULTIPART_FORM_DATA); return request; }
private <T> JerseyRequest<T> getBuilder(Class<T> responseClass) { JerseyRequest<T> request = buildRequest( sessionStorage, responseClass, new String[] {"/resources"}, new DefaultErrorHandler()); request.addParams(params); return request; }
private JerseyRequest<ClientResource> prepareCopyOrMoveRequest(String fromUri) { JerseyRequest<ClientResource> request = buildRequest( sessionStorage, ClientResource.class, new String[] {"/resources", resourceUri}, new DefaultErrorHandler()); request.addParams(params); request.addHeader("Content-Location", fromUri); return request; }
private JerseyRequest<ClientResource> prepareDetailsRequest() { JerseyRequest<ClientResource> request = buildRequest( sessionStorage, ClientResource.class, new String[] {"/resources", resourceUri}); request.addParams(params); if (isRootFolder(resourceUri)) { request.setAccept(ResourceMediaType.FOLDER_JSON); } else { request.setAccept(ResourceMediaType.FILE_JSON); } return request; }
private JerseyRequest<ClientResource> prepareCreateOrUpdateRequest(ClientResource resource) { Class<? extends ClientResource> resourceType = ResourcesTypeResolverUtil.getResourceType(resource); JerseyRequest<? extends ClientResource> request = buildRequest( sessionStorage, resourceType, new String[] {"/resources", resourceUri}, new DefaultErrorHandler()); request.setContentType( MimeTypeUtil.toCorrectContentMime( sessionStorage.getConfiguration(), ResourcesTypeResolverUtil.getMimeType(resourceType))); request.addParams(params); return (JerseyRequest<ClientResource>) request; }