chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
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 GMT
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;
     }



Mime
View raw message