This project has retired. For details please refer to its
Attic page.
MultiFilingServiceImpl xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.client.bindings.spi.browser;
2021import java.io.OutputStream;
2223import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
24import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
25import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
26import org.apache.chemistry.opencmis.commons.impl.Constants;
27import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
28import org.apache.chemistry.opencmis.commons.spi.MultiFilingService;
2930/**31 * MultiFiling Service Browser Binding client.32 */33publicclassMultiFilingServiceImplextendsAbstractBrowserBindingService implements MultiFilingService {
3435/**36 * Constructor.37 */38publicMultiFilingServiceImpl(BindingSession session) {
39 setSession(session);
40 }
4142publicvoid addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
43 ExtensionsData extension) {
44// build URL45 UrlBuilder url = getObjectUrl(repositoryId, objectId);
4647// prepare form data48finalFormDataWriter formData = newFormDataWriter(Constants.CMISACTION_ADD_OBJECT_TO_FOLDER);
49 formData.addParameter(Constants.PARAM_FOLDER_ID, folderId);
50 formData.addParameter(Constants.PARAM_ALL_VERSIONS, allVersions);
5152// send and parse53 postAndConsume(url, formData.getContentType(), new HttpUtils.Output() {
54publicvoid write(OutputStream out) throws Exception {
55 formData.write(out);
56 }
57 });
58 }
5960publicvoid removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
61// build URL62 UrlBuilder url = getObjectUrl(repositoryId, objectId);
6364// prepare form data65finalFormDataWriter formData = newFormDataWriter(Constants.CMISACTION_REMOVE_OBJECT_FROM_FOLDER);
66 formData.addParameter(Constants.PARAM_FOLDER_ID, folderId);
6768// send and parse69 postAndConsume(url, formData.getContentType(), new HttpUtils.Output() {
70publicvoid write(OutputStream out) throws Exception {
71 formData.write(out);
72 }
73 });
74 }
75 }