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 4A97D96D6 for ; Thu, 2 Feb 2012 17:02:38 +0000 (UTC) Received: (qmail 23472 invoked by uid 500); 2 Feb 2012 17:02:38 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 23425 invoked by uid 500); 2 Feb 2012 17:02:37 -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 23415 invoked by uid 99); 2 Feb 2012 17:02:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2012 17:02:37 +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; Thu, 02 Feb 2012 17:02:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 987B62388A29; Thu, 2 Feb 2012 17:02:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1239721 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/... Date: Thu, 02 Feb 2012 17:02:12 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120202170212.987B62388A29@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmui Date: Thu Feb 2 17:02:11 2012 New Revision: 1239721 URL: http://svn.apache.org/viewvc?rev=1239721&view=rev Log: code clean up Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java?rev=1239721&r1=1239720&r2=1239721&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java Thu Feb 2 17:02:11 2012 @@ -172,7 +172,7 @@ public class FolderImpl extends Abstract getSession().removeObjectFromCache(this); } - return failed.getIds(); + return (failed != null ? failed.getIds() : null); } public String getParentId() { Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java?rev=1239721&r1=1239720&r2=1239721&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java Thu Feb 2 17:02:11 2012 @@ -56,7 +56,7 @@ public class FileUtils { /** * Gets an object by path or object id. - * + * * @param pathOrIdOfObject * the path or object id * @param session @@ -84,7 +84,7 @@ public class FileUtils { /** * Gets a folder by path or object id. - * + * * @param pathOrIdOfObject * the path or folder id * @param session @@ -104,7 +104,7 @@ public class FileUtils { /** * Creates a document from a file. - * + * * @param parentIdOrPath * the id or path of the parent folder * @param file @@ -140,7 +140,7 @@ public class FileUtils { /** * Creates a text document from a string. - * + * * @param parentIdOrPath * the id or path of the parent folder * @param name @@ -168,8 +168,8 @@ public class FileUtils { properties.put(PropertyIds.NAME, name); ByteArrayInputStream bais = new ByteArrayInputStream(content == null ? new byte[0] : content.getBytes()); - ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content.getBytes().length), - "text/plain", bais); + ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content == null ? 0 : content + .getBytes().length), "text/plain", bais); return parentFolder.createDocument(properties, contentStream, versioningState); } @@ -177,7 +177,7 @@ public class FileUtils { /** * Creates a child folder with the name specified of the type specified. If * type is null then will default to cmis:folder. - * + * * @param parentFolder * the parent folder * @param name @@ -201,7 +201,7 @@ public class FileUtils { /** * Creates a folder using a String identifier. - * + * * @param parentIdOrPath * the id or path of the parent folder * @param name @@ -229,7 +229,7 @@ public class FileUtils { /** * Downloads the contentStream for the given doc to the specified path. - * + * * @param doc * the document * @param destinationPath @@ -246,7 +246,7 @@ public class FileUtils { /** * Downloads a document by its id or path. - * + * * @param docIdOrPath * the id or path of the document * @param destinationPath @@ -276,7 +276,7 @@ public class FileUtils { /** * Deletes an object by path or id (string identifier). - * + * * @param pathOrIdOfObject * the id or path of the object * @param session @@ -295,7 +295,7 @@ public class FileUtils { /** * Prints out all of the properties for this object to System.out. - * + * * @param object * the object */ @@ -306,7 +306,7 @@ public class FileUtils { /** * Prints out all of the properties for this object to the given * PrintStream. - * + * * @param object * the object */ Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java?rev=1239721&r1=1239720&r2=1239721&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java Thu Feb 2 17:02:11 2012 @@ -1522,8 +1522,6 @@ public class JSONConverter { result.setRenditions(convertRenditions(jsonRenditions)); } - // TODO - convertExtension(json, result, OBJECT_KEYS); return result; Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java?rev=1239721&r1=1239720&r2=1239721&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Thu Feb 2 17:02:11 2012 @@ -516,7 +516,9 @@ public abstract class AbstractSessionTes "Test folder could not be created! Exception: " + e.getMessage(), e, true)); } - testFolder = createFolder(session, parent, name); + if (parent != null) { + testFolder = createFolder(session, parent, name); + } return testFolder; }