Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4250D7CE for ; Mon, 27 May 2013 17:22:08 +0000 (UTC) Received: (qmail 68928 invoked by uid 500); 27 May 2013 17:22:08 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 68765 invoked by uid 500); 27 May 2013 17:22:07 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 68565 invoked by uid 99); 27 May 2013 17:22:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 17:22:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 17:21:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9466A2388C70; Mon, 27 May 2013 17:20:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1486674 [32/44] - in /chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings: ./ css/ images/ images/logos/ xref-test/ xref-test/org/ xref-test/org/apache/ xref-test/org/apache/chemistry/... Date: Mon, 27 May 2013 17:20:22 -0000 To: commits@chemistry.apache.org From: gabriele@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130527172035.9466A2388C70@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.html?rev=1486674&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.html (added) +++ chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.html Mon May 27 17:20:16 2013 @@ -0,0 +1,212 @@ + + + + +VersioningServiceImpl xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.client.bindings.spi.browser;
+20  
+21  import java.io.OutputStream;
+22  import java.util.List;
+23  import java.util.Map;
+24  
+25  import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
+26  import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+27  import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
+28  import org.apache.chemistry.opencmis.commons.data.Acl;
+29  import org.apache.chemistry.opencmis.commons.data.ContentStream;
+30  import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
+31  import org.apache.chemistry.opencmis.commons.data.ObjectData;
+32  import org.apache.chemistry.opencmis.commons.data.Properties;
+33  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+34  import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+35  import org.apache.chemistry.opencmis.commons.impl.Constants;
+36  import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+37  import org.apache.chemistry.opencmis.commons.impl.ReturnVersion;
+38  import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+39  import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
+40  import org.apache.chemistry.opencmis.commons.spi.Holder;
+41  import org.apache.chemistry.opencmis.commons.spi.VersioningService;
+42  
+43  /**
+44   * Versioning Service Browser Binding client.
+45   */
+46  public class VersioningServiceImpl extends AbstractBrowserBindingService implements VersioningService {
+47  
+48      /**
+49       * Constructor.
+50       */
+51      public VersioningServiceImpl(BindingSession session) {
+52          setSession(session);
+53      }
+54  
+55      public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+56              Holder<Boolean> contentCopied) {
+57          // we need an object id
+58          if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
+59              throw new CmisInvalidArgumentException("Object id must be set!");
+60          }
+61  
+62          // build URL
+63          UrlBuilder url = getObjectUrl(repositoryId, objectId.getValue());
+64  
+65          // prepare form data
+66          final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CHECK_OUT);
+67          formData.addSuccinctFlag(getSuccinct());
+68  
+69          // send and parse
+70          Response resp = post(url, formData.getContentType(), new Output() {
+71              public void write(OutputStream out) throws Exception {
+72                  formData.write(out);
+73              }
+74          });
+75  
+76          Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
+77  
+78          TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
+79  
+80          ObjectData newObj = JSONConverter.convertObject(json, typeCache);
+81  
+82          objectId.setValue(newObj == null ? null : newObj.getId());
+83      }
+84  
+85      public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+86          // build URL
+87          UrlBuilder url = getObjectUrl(repositoryId, objectId);
+88  
+89          // prepare form data
+90          final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CANCEL_CHECK_OUT);
+91  
+92          // send
+93          postAndConsume(url, formData.getContentType(), new Output() {
+94              public void write(OutputStream out) throws Exception {
+95                  formData.write(out);
+96              }
+97          });
+98      }
+99  
+100     public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
+101             ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
+102             ExtensionsData extension) {
+103         // we need an object id
+104         if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
+105             throw new CmisInvalidArgumentException("Object id must be set!");
+106         }
+107 
+108         // build URL
+109         UrlBuilder url = getObjectUrl(repositoryId, objectId.getValue());
+110 
+111         // prepare form data
+112         final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_CHECK_IN, contentStream);
+113         formData.addParameter(Constants.PARAM_MAJOR, major);
+114         formData.addPropertiesParameters(properties);
+115         formData.addParameter(Constants.PARAM_CHECKIN_COMMENT, checkinComment);
+116         formData.addPoliciesParameters(policies);
+117         formData.addAddAcesParameters(addAces);
+118         formData.addRemoveAcesParameters(removeAces);
+119         formData.addSuccinctFlag(getSuccinct());
+120 
+121         // send and parse
+122         Response resp = post(url, formData.getContentType(), new Output() {
+123             public void write(OutputStream out) throws Exception {
+124                 formData.write(out);
+125             }
+126         });
+127 
+128         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
+129 
+130         TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
+131 
+132         ObjectData newObj = JSONConverter.convertObject(json, typeCache);
+133 
+134         objectId.setValue(newObj == null ? null : newObj.getId());
+135     }
+136 
+137     public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+138             Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+139             String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
+140         // build URL
+141         UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_OBJECT);
+142         url.addParameter(Constants.PARAM_FILTER, filter);
+143         url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+144         url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+145         url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
+146         url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
+147         url.addParameter(Constants.PARAM_ACL, includeAcl);
+148         url.addParameter(Constants.PARAM_RETURN_VERSION,
+149                 (major == null || Boolean.FALSE.equals(major) ? ReturnVersion.LATEST : ReturnVersion.LASTESTMAJOR));
+150         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+151 
+152         // read and parse
+153         Response resp = read(url);
+154         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
+155 
+156         TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
+157 
+158         return JSONConverter.convertObject(json, typeCache);
+159     }
+160 
+161     public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+162             Boolean major, String filter, ExtensionsData extension) {
+163         // build URL
+164         UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_PROPERTIES);
+165         url.addParameter(Constants.PARAM_FILTER, filter);
+166         url.addParameter(Constants.PARAM_RETURN_VERSION,
+167                 (major == null || Boolean.FALSE.equals(major) ? ReturnVersion.LATEST : ReturnVersion.LASTESTMAJOR));
+168         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+169 
+170         // read and parse
+171         Response resp = read(url);
+172         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
+173 
+174         if (getSuccinct()) {
+175             TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
+176             return JSONConverter.convertSuccinctProperties(json, null, typeCache);
+177         } else {
+178             return JSONConverter.convertProperties(json, null);
+179         }
+180     }
+181 
+182     public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
+183             Boolean includeAllowableActions, ExtensionsData extension) {
+184         // build URL
+185         UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_VERSIONS);
+186         url.addParameter(Constants.PARAM_FILTER, filter);
+187         url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+188         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
+189 
+190         // read and parse
+191         Response resp = read(url);
+192         List<Object> json = parseArray(resp.getStream(), resp.getCharset());
+193 
+194         TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
+195 
+196         return JSONConverter.convertObjects(json, typeCache);
+197     }
+198 }
+
+
+ + Added: chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-frame.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-frame.html?rev=1486674&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-frame.html (added) +++ chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-frame.html Mon May 27 17:20:16 2013 @@ -0,0 +1,66 @@ + + + + + + OpenCMIS Client Bindings Implementation 0.9.0 Reference Package org.apache.chemistry.opencmis.client.bindings.spi.browser + + + + +

+ org.apache.chemistry.opencmis.client.bindings.spi.browser +

+ +

Classes

+ + + + + \ No newline at end of file Added: chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-summary.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-summary.html?rev=1486674&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-summary.html (added) +++ chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/browser/package-summary.html Mon May 27 17:20:16 2013 @@ -0,0 +1,137 @@ + + + + + + OpenCMIS Client Bindings Implementation 0.9.0 Reference Package org.apache.chemistry.opencmis.client.bindings.spi.browser + + + +
+ +
+
+ +
+ +

Package org.apache.chemistry.opencmis.client.bindings.spi.browser

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ AbstractBrowserBindingService +
+ AclServiceImpl +
+ ClientTypeCacheImpl +
+ CmisBrowserBindingSpi +
+ DiscoveryServiceImpl +
+ FormDataWriter +
+ MultiFilingServiceImpl +
+ NavigationServiceImpl +
+ ObjectServiceImpl +
+ PolicyServiceImpl +
+ RelationshipServiceImpl +
+ RepositoryServiceImpl +
+ RepositoryUrlCache +
+ SpiSessionParameter +
+ VersioningServiceImpl +
+ +
+ +
+
+ +
+
+ Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Added: chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.html?rev=1486674&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.html (added) +++ chemistry/site/trunk/content/java/0.9.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-bindings/xref/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.html Mon May 27 17:20:16 2013 @@ -0,0 +1,232 @@ + + + + +CmisCookieManager xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  /*
+20   * This class has been taken from Apache Harmony (http://harmony.apache.org/) 
+21   * and has been modified to work with OpenCMIS.
+22   */
+23  package org.apache.chemistry.opencmis.client.bindings.spi.cookies;
+24  
+25  import java.io.IOException;
+26  import java.io.Serializable;
+27  import java.net.URI;
+28  import java.net.URISyntaxException;
+29  import java.util.ArrayList;
+30  import java.util.Collections;
+31  import java.util.HashMap;
+32  import java.util.List;
+33  import java.util.Map;
+34  import java.util.concurrent.locks.ReentrantReadWriteLock;
+35  
+36  import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
+37  import org.slf4j.Logger;
+38  import org.slf4j.LoggerFactory;
+39  
+40  /**
+41   * Cookie Manager.
+42   * 
+43   * This implementation conforms to RFC 2965, section 3.3 with some RFC 6265
+44   * extensions.
+45   */
+46  public class CmisCookieManager implements Serializable {
+47      private static final long serialVersionUID = 1L;
+48  
+49      private static final Logger LOG = LoggerFactory.getLogger(CmisCookieManager.class.getName());
+50  
+51      private static final String VERSION_ZERO_HEADER = "Set-cookie";
+52      private static final String VERSION_ONE_HEADER = "Set-cookie2";
+53  
+54      private final CmisCookieStoreImpl store;
+55      private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+56  
+57      /**
+58       * Constructs a new cookie manager.
+59       */
+60      public CmisCookieManager() {
+61          store = new CmisCookieStoreImpl();
+62      }
+63  
+64      /**
+65       * Searchs and gets all cookies in the cache by the specified uri in the
+66       * request header.
+67       * 
+68       * @param uri
+69       *            the specified uri to search for
+70       * @param requestHeaders
+71       *            a list of request headers
+72       * @return a map that record all such cookies, the map is unchangeable
+73       */
+74      public Map<String, List<String>> get(String url, Map<String, List<String>> requestHeaders) {
+75          if (url == null || requestHeaders == null) {
+76              throw new IllegalArgumentException("URL or headers are null!");
+77          }
+78  
+79          URI uri;
+80          try {
+81              uri = new URI(url);
+82          } catch (URISyntaxException e) {
+83              throw new CmisConnectionException(e.getMessage(), e);
+84          }
+85  
+86          lock.writeLock().lock();
+87          try {
+88              List<CmisHttpCookie> cookies = store.get(uri);
+89              for (int i = 0; i < cookies.size(); i++) {
+90                  CmisHttpCookie cookie = cookies.get(i);
+91                  String uriPath = uri.getPath();
+92                  String cookiePath = cookie.getPath();
+93                  // if the uri's path does not path-match cookie's path, remove
+94                  // cookies from the list
+95                  if (cookiePath == null || uriPath.length() == 0 || !uriPath.startsWith(cookiePath)) {
+96                      cookies.remove(i);
+97                  }
+98              }
+99  
+100             Map<String, List<String>> map = getCookieMap(cookies, requestHeaders);
+101 
+102             if (LOG.isDebugEnabled()) {
+103                 if (map != null && !map.isEmpty()) {
+104                     LOG.debug("Setting cookies for URL " + url + ": " + map.get("Cookie"));
+105                 }
+106             }
+107 
+108             return map;
+109         } finally {
+110             lock.writeLock().unlock();
+111         }
+112     }
+113 
+114     private static Map<String, List<String>> getCookieMap(List<CmisHttpCookie> cookies,
+115             Map<String, List<String>> requestHeaders) {
+116         HashMap<String, List<String>> map = new HashMap<String, List<String>>();
+117         ArrayList<String> cookieStr = new ArrayList<String>();
+118         // If all cookies are version 1, add a "$Version="1"" header
+119         boolean versionOne = true;
+120         for (CmisHttpCookie cookie : cookies) {
+121             if (cookie.getVersion() == 0) {
+122                 versionOne = false;
+123                 break;
+124             }
+125         }
+126         if (versionOne && !cookies.isEmpty()) {
+127             cookieStr.add("$Version=\"1\"");
+128         }
+129         // add every cookie's string representation into map
+130         for (CmisHttpCookie cookie : cookies) {
+131             cookieStr.add(cookie.toString());
+132         }
+133 
+134         if (cookieStr.isEmpty()) {
+135             return Collections.emptyMap();
+136         }
+137 
+138         map.put("Cookie", cookieStr);
+139         return map;
+140     }
+141 
+142     /**
+143      * Sets cookies according to uri and responseHeaders
+144      * 
+145      * @param uri
+146      *            the specified uri
+147      * @param responseHeaders
+148      *            a list of request headers
+149      * @throws IOException
+150      *             if some error of I/O operation occurs
+151      */
+152     public void put(String url, Map<String, List<String>> responseHeaders) {
+153         if (url == null || responseHeaders == null) {
+154             throw new IllegalArgumentException("URL or headers are null!");
+155         }
+156 
+157         URI uri;
+158         try {
+159             uri = new URI(url);
+160         } catch (URISyntaxException e) {
+161             throw new CmisConnectionException(e.getMessage(), e);
+162         }
+163 
+164         lock.writeLock().lock();
+165         try {
+166             // parse and construct cookies according to the map
+167             List<CmisHttpCookie> cookies = parseCookie(responseHeaders);
+168             for (CmisHttpCookie cookie : cookies) {
+169                 if (cookie.getDomain() == null) {
+170                     cookie.setDomain(uri.getHost());
+171                 }
+172                 if (cookie.getPath() == null) {
+173                     cookie.setPath("/");
+174                 }
+175                 store.add(uri, cookie);
+176             }
+177 
+178             if (LOG.isDebugEnabled()) {
+179                 if (!cookies.isEmpty()) {
+180                     LOG.debug("Retrieved cookies for URL " + url + ": " + cookies);
+181                 }
+182             }
+183         } finally {
+184             lock.writeLock().unlock();
+185         }
+186     }
+187 
+188     private static List<CmisHttpCookie> parseCookie(Map<String, List<String>> responseHeaders) {
+189         List<CmisHttpCookie> cookies = new ArrayList<CmisHttpCookie>();
+190         for (Map.Entry<String, List<String>> entry : responseHeaders.entrySet()) {
+191             String key = entry.getKey();
+192             // Only "Set-cookie" and "Set-cookie2" pair will be parsed
+193             if (key != null && (key.equalsIgnoreCase(VERSION_ZERO_HEADER) || key.equalsIgnoreCase(VERSION_ONE_HEADER))) {
+194                 // parse list elements one by one
+195                 for (String cookieStr : entry.getValue()) {
+196                     try {
+197                         for (CmisHttpCookie cookie : CmisHttpCookie.parse(cookieStr)) {
+198                             cookies.add(cookie);
+199                         }
+200                     } catch (IllegalArgumentException e) {
+201                         // this string is invalid, jump to the next one.
+202                     }
+203                 }
+204             }
+205         }
+206 
+207         return cookies;
+208     }
+209 
+210     /**
+211      * Gets current cookie store.
+212      * 
+213      * @return the cookie store currently used by cookie manager.
+214      */
+215     public CmisCookieStoreImpl getCookieStore() {
+216         return store;
+217     }
+218 }
+
+
+ +