chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1511250 [1/2] - in /chemistry/opencmis/trunk: chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ chemistry-opencmis-android/chemistry-opencmis-android-client/s...
Date Wed, 07 Aug 2013 11:35:43 GMT
Author: fmui
Date: Wed Aug  7 11:35:42 2013
New Revision: 1511250

URL: http://svn.apache.org/r1511250
Log:
code clean up and smaller fixes

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ApacheClientHttpInvoker.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/AbstractApacheClientHttpInvoker.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/CmisEnumHelper.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-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/BaseTypesTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/CheckedOutTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/Configurator.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/PropertyMapperExif.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/content/fractal/FractalGenerator.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/content/loremipsum/LoremIpsum.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TckDialog.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ApacheClientHttpInvoker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ApacheClientHttpInvoker.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ApacheClientHttpInvoker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/ApacheClientHttpInvoker.java Wed Aug  7 11:35:42 2013
@@ -141,8 +141,8 @@ public class ApacheClientHttpInvoker ext
                 int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
                 try {
-                    sock.setSoTimeout(soTimeout);
-                    sock.connect(remoteAddress, connTimeout);
+                    sslSocket.setSoTimeout(soTimeout);
+                    sslSocket.connect(remoteAddress, connTimeout);
                 } catch (SocketTimeoutException ex) {
                     closeSocket(sock);
                     throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out!");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java Wed Aug  7 11:35:42 2013
@@ -24,9 +24,7 @@ import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.EnumSet;
 import java.util.GregorianCalendar;
-import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -1048,28 +1046,25 @@ public class XMLConverter {
         }
 
         String namespace = null;
-        //boolean addedNamespace = false;
+        // boolean addedNamespace = false;
 
         if (source.getNamespace() != null) {
-           /* String prefix = writer.getPrefix(source.getNamespace(), false);
-            if (prefix == null) {
-                int p = ns.indexOf(source.getNamespace());
-
-                if (p == -1) {
-                    prefix = "e" + (ns.size() + 1);
-                    ns.add(source.getNamespace());
-                    addedNamespace = true;
-                } else {
-                    prefix = "e" + (p + 1);
-                }
-            }*/
+            /*
+             * String prefix = writer.getPrefix(source.getNamespace(), false);
+             * if (prefix == null) { int p = ns.indexOf(source.getNamespace());
+             * 
+             * if (p == -1) { prefix = "e" + (ns.size() + 1);
+             * ns.add(source.getNamespace()); addedNamespace = true; } else {
+             * prefix = "e" + (p + 1); } }
+             */
 
             namespace = source.getNamespace();
             writer.startTag(source.getNamespace(), source.getName());
 
-            /*if (addedNamespace) {
-                writer.attribute("", prefix, source.getNamespace());
-            }*/
+            /*
+             * if (addedNamespace) { writer.attribute("", prefix,
+             * source.getNamespace()); }
+             */
         } else {
             writer.startTag(null, source.getName());
         }
@@ -1092,9 +1087,9 @@ public class XMLConverter {
 
         writer.endTag(namespace, source.getName());
 
-        /*if (addedNamespace) {
-            ns.removeLast();
-        }*/
+        /*
+         * if (addedNamespace) { ns.removeLast(); }
+         */
     }
 
     // ---------------
@@ -1349,10 +1344,6 @@ public class XMLConverter {
             if (isCmisNamespace(name)) {
                 if (isTag(name, TAG_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE)) {
                     Set<PropertyType> ptSet = target.canCreate();
-                    if (ptSet == null) {
-                        ptSet = EnumSet.noneOf(PropertyType.class);
-                        target.setCanCreate(ptSet);
-                    }
 
                     ptSet.add(readEnum(parser, PropertyType.class));
                     return true;
@@ -1471,10 +1462,6 @@ public class XMLConverter {
 
                 if (isTag(name, TAG_ACLCAP_PERMISSION_MAPPING)) {
                     Map<String, PermissionMapping> mapping = target.getPermissionMapping();
-                    if (mapping == null) {
-                        mapping = new HashMap<String, PermissionMapping>();
-                        target.setPermissionMappingData(mapping);
-                    }
 
                     PermissionMapping pm = PERMISSION_MAPPING_PARSER.walk(parser);
                     mapping.put(pm.getKey(), pm);
@@ -1499,7 +1486,7 @@ public class XMLConverter {
                 throws XmlPullParserException {
             if (isCmisNamespace(name)) {
                 if (isTag(name, TAG_ACLCAP_PERMISSION_PERMISSION)) {
-                    target.setPermission(readText(parser));
+                    target.setId(readText(parser));
                     return true;
                 }
 
@@ -1576,10 +1563,6 @@ public class XMLConverter {
 
                 if (isTag(name, TAG_FEATURE_DATA)) {
                     Map<String, String> featureData = target.getFeatureData();
-                    if (featureData == null) {
-                        featureData = new HashMap<String, String>();
-                        target.setFeatureData(featureData);
-                    }
 
                     String[] data = FEATURE_DATA_PARSER.walk(parser);
                     featureData.put(data[0], data[1]);
@@ -2324,10 +2307,6 @@ public class XMLConverter {
                     Action action = Action.fromValue(name.getLocalPart());
 
                     Set<Action> actions = target.getAllowableActions();
-                    if (actions == null) {
-                        actions = EnumSet.noneOf(Action.class);
-                        target.setAllowableActions(actions);
-                    }
 
                     if (Boolean.TRUE.equals(readBoolean(parser))) {
                         actions.add(action);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Wed Aug  7 11:35:42 2013
@@ -206,12 +206,7 @@ public class XMLUtils {
     }
 
     public static boolean hasNext(XmlPullParser parser) throws XmlPullParserException {
-        int event = parser.getEventType();
-        if (event == XmlPullParser.END_DOCUMENT) {
-            return false;
-        } else {
-            return true;
-        }
+        return parser.getEventType() != XmlPullParser.END_DOCUMENT;
     }
 
     /**

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java Wed Aug  7 11:35:42 2013
@@ -175,9 +175,6 @@ public abstract class XMLWalker<T> {
 
     protected Boolean readBoolean(final XmlPullParser parser) throws XmlPullParserException {
         String value = readText(parser);
-        if (value == null) {
-            return null;
-        }
 
         if ("true".equals(value) || "1".equals(value)) {
             return Boolean.TRUE;
@@ -192,10 +189,7 @@ public abstract class XMLWalker<T> {
 
     protected BigInteger readInteger(final XmlPullParser parser) throws XmlPullParserException {
         String value = readText(parser);
-        if (value == null) {
-            return null;
-        }
-
+        
         try {
             return new BigInteger(value);
         } catch (NumberFormatException e) {
@@ -205,9 +199,6 @@ public abstract class XMLWalker<T> {
 
     protected BigDecimal readDecimal(final XmlPullParser parser) throws XmlPullParserException {
         String value = readText(parser);
-        if (value == null) {
-            return null;
-        }
 
         try {
             return new BigDecimal(value);
@@ -218,9 +209,6 @@ public abstract class XMLWalker<T> {
 
     protected GregorianCalendar readDateTime(final XmlPullParser parser) throws XmlPullParserException {
         String value = readText(parser);
-        if (value == null) {
-            return null;
-        }
 
         GregorianCalendar result = DateTimeHelper.parseXmlDateTime(value);
         if (result == null) {
@@ -234,9 +222,6 @@ public abstract class XMLWalker<T> {
     public <E extends Enum<E>> E readEnum(final XmlPullParser parser, final Class<E> clazz)
             throws XmlPullParserException {
         String value = readText(parser);
-        if (value == null) {
-            return null;
-        }
 
         try {
             Method m = clazz.getMethod("fromValue", String.class);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java Wed Aug  7 11:35:42 2013
@@ -133,7 +133,7 @@ public class CmisBindingImpl implements 
             try {
                 session.put(CmisBindingsHelper.FORCE_CMIS_VERSION, CmisVersion.fromValue(forceCmisVersion));
             } catch (IllegalArgumentException e) {
-                throw new IllegalArgumentException("Invalid CMIS version value: " + forceCmisVersion);
+                throw new IllegalArgumentException("Invalid CMIS version value: " + forceCmisVersion, e);
             }
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java Wed Aug  7 11:35:42 2013
@@ -47,8 +47,6 @@ public class StandardAuthenticationProvi
     protected static final String WSSE_NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
     protected static final String WSU_NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
 
-    private boolean sendBasicAuth;
-    private boolean sendUsernameToken;
     private CmisCookieManager cookieManager;
     private Map<String, List<String>> fixedHeaders = new HashMap<String, List<String>>();
 
@@ -56,8 +54,7 @@ public class StandardAuthenticationProvi
     public void setSession(BindingSession session) {
         super.setSession(session);
 
-        sendBasicAuth = getSendBasicAuth();
-        sendUsernameToken = getSendUsernameToken();
+        boolean sendBasicAuth = getSendBasicAuth();
 
         if (getHandleCookies()) {
             cookieManager = new CmisCookieManager();
@@ -113,7 +110,7 @@ public class StandardAuthenticationProvi
     @Override
     public Element getSOAPHeaders(Object portObject) {
         // only send SOAP header if configured
-        if (!sendUsernameToken) {
+        if (!getSendUsernameToken()) {
             return null;
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java Wed Aug  7 11:35:42 2013
@@ -28,6 +28,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -79,7 +80,7 @@ public final class CmisHttpCookie implem
         }
     }
 
-    private HashMap<String, Setter> attributeSet = new HashMap<String, Setter>();
+    private Map<String, Setter> attributeSet = new HashMap<String, Setter>();
 
     /**
      * A utility method used to check whether the host name is in a domain or
@@ -306,7 +307,7 @@ public final class CmisHttpCookie implem
                 try {
                     cookie.setMaxAge(Long.parseLong(value));
                 } catch (NumberFormatException e) {
-                    throw new IllegalArgumentException("Invalid max-age!");
+                    throw new IllegalArgumentException("Invalid max-age!", e);
                 }
                 set(true);
 
@@ -355,7 +356,7 @@ public final class CmisHttpCookie implem
                         cookie.setVersion(v);
                     }
                 } catch (NumberFormatException e) {
-                    throw new IllegalArgumentException("Invalid version!");
+                    throw new IllegalArgumentException("Invalid version!", e);
                 }
                 if (cookie.getVersion() != 0) {
                     set(true);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/AbstractApacheClientHttpInvoker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/AbstractApacheClientHttpInvoker.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/AbstractApacheClientHttpInvoker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/AbstractApacheClientHttpInvoker.java Wed Aug  7 11:35:42 2013
@@ -237,7 +237,7 @@ public abstract class AbstractApacheClie
                         } catch (IOException ioe) {
                             throw ioe;
                         } catch (Exception e) {
-                            new IOException(e);
+                            throw new IOException(e);
                         }
                         out.flush();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java Wed Aug  7 11:35:42 2013
@@ -597,7 +597,7 @@ public abstract class AbstractPortProvid
                     return new URL(location);
                 } catch (MalformedURLException e) {
                     throw new CmisRuntimeException("This service provides an invalid endpoint address: "
-                            + service.getServiceName());
+                            + service.getServiceName(), e);
                 }
             }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/CmisEnumHelper.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/CmisEnumHelper.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/CmisEnumHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/CmisEnumHelper.java Wed Aug  7 11:35:42 2013
@@ -106,7 +106,7 @@ public class CmisEnumHelper {
                 return (E) CapabilityRenditions.fromValue(value);
             }
         } catch (IllegalArgumentException e) {
-            throw new CmisInvalidArgumentException("Invalid enum value '" + value + "'!");
+            throw new CmisInvalidArgumentException("Invalid enum value '" + value + "'!", e);
         }
 
         throw new CmisRuntimeException(clazz.getSimpleName() + " is not a CMIS enum!");
@@ -123,7 +123,7 @@ public class CmisEnumHelper {
                 return (E) DecimalPrecision.fromValue(value);
             }
         } catch (IllegalArgumentException e) {
-            throw new CmisInvalidArgumentException("Invalid enum value '" + value + "'!");
+            throw new CmisInvalidArgumentException("Invalid enum value '" + value + "'!", e);
         }
 
         throw new CmisRuntimeException(clazz.getSimpleName() + " is not a CMIS enum!");

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=1511250&r1=1511249&r2=1511250&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 Wed Aug  7 11:35:42 2013
@@ -1996,7 +1996,7 @@ public final class JSONConverter {
                 try {
                     propertyType = PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
                 } catch (Exception e) {
-                    throw new CmisRuntimeException("Invalid property: " + id);
+                    throw new CmisRuntimeException("Invalid property: " + id, e);
                 }
 
                 Object value = jsonPropertyMap.get(JSON_PROPERTY_VALUE);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.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/WSConverter.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java Wed Aug  7 11:35:42 2013
@@ -2908,6 +2908,7 @@ public final class WSConverter {
                 target.setExtensions(null);
             }
         } catch (NoSuchMethodException e) {
+            // ignore
         } catch (Exception e) {
             throw new CmisRuntimeException("Exception: " + e.getMessage(), e);
         }
@@ -2930,6 +2931,7 @@ public final class WSConverter {
                 }
             }
         } catch (NoSuchMethodException e) {
+            // ignore
         } catch (Exception e) {
             throw new CmisRuntimeException("Exception: " + e.getMessage(), e);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.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/XMLUtils.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Wed Aug  7 11:35:42 2013
@@ -63,6 +63,7 @@ public class XMLUtils {
             XML_OUTPUT_FACTORY.setProperty("reuse-instance", Boolean.FALSE);
             LOG.warn("You are using an unsupported StAX parser.");
         } catch (IllegalArgumentException ex) {
+            // expected for Woodstox
         }
 
         XML_OUTPUT_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.FALSE);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java Wed Aug  7 11:35:42 2013
@@ -286,6 +286,11 @@ public class CmisAtomPubServlet extends 
             LOG.error(ex.getMessage(), ex);
         }
 
+        if (response.isCommitted()) {
+            LOG.warn("Failed to send error message to client. Response is already committed.", ex);
+            return;
+        }
+
         try {
             PrintWriter pw = response.getWriter();
             response.setStatus(statusCode);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java Wed Aug  7 11:35:42 2013
@@ -436,6 +436,11 @@ public class CmisBrowserBindingServlet e
                 LOG.error(ex.getMessage(), ex);
             }
 
+            if (response.isCommitted()) {
+                LOG.warn("Failed to send error message to client. Response is already committed.", ex);
+                return;
+            }
+
             String token = (context instanceof BrowserCallContextImpl ? ((BrowserCallContextImpl) context).getToken()
                     : null);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java Wed Aug  7 11:35:42 2013
@@ -440,7 +440,7 @@ public class FileShareRepository {
         try {
             newFile.createNewFile();
         } catch (IOException e) {
-            throw new CmisStorageException("Could not create file: " + e.getMessage());
+            throw new CmisStorageException("Could not create file: " + e.getMessage(), e);
         }
 
         // write content, if available

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java Wed Aug  7 11:35:42 2013
@@ -183,6 +183,7 @@ public class LoggingFilter implements Fi
                 String line = scanner.nextLine();
                 pw.println(line);
             }
+            scanner.close();
 
             pw.flush();
         } catch (IOException e) {
@@ -339,7 +340,7 @@ public class LoggingFilter implements Fi
         return requestNo++;
     }
 
-    private class LoggingRequestWrapper extends HttpServletRequestWrapper {
+    private static class LoggingRequestWrapper extends HttpServletRequestWrapper {
 
         private LoggingInputStream is;
 
@@ -358,7 +359,7 @@ public class LoggingFilter implements Fi
         }
     }
 
-    private class LoggingInputStream extends ServletInputStream {
+    private static class LoggingInputStream extends ServletInputStream {
 
         private ByteArrayOutputStream baous = new ByteArrayOutputStream();
         private ServletInputStream is;
@@ -411,7 +412,7 @@ public class LoggingFilter implements Fi
         }
     }
 
-    private class LoggingResponseWrapper extends HttpServletResponseWrapper {
+    private static class LoggingResponseWrapper extends HttpServletResponseWrapper {
 
         private LoggingOutputStream os;
         private PrintWriter writer;
@@ -581,7 +582,7 @@ public class LoggingFilter implements Fi
         }
     }
 
-    private class LoggingOutputStream extends ServletOutputStream {
+    private static class LoggingOutputStream extends ServletOutputStream {
         private ByteArrayOutputStream baous = new ByteArrayOutputStream();
         private ServletOutputStream os;
 
@@ -591,7 +592,7 @@ public class LoggingFilter implements Fi
         }
 
         public String getPayload() {
-            return new String(baous.toString());
+            return new String(baous.toByteArray());
         }
 
         @Override

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java Wed Aug  7 11:35:42 2013
@@ -251,11 +251,13 @@ public class BrowseServlet extends HttpS
                 out.flush();
                 out.close();
             } catch (Exception e) {
+                // ignore, there isn't anything we can do
             }
 
             try {
                 in.close();
             } catch (Exception e) {
+                // ignore, there isn't anything we can do
             }
         } catch (Exception e) {
             printError(req, resp, e.getMessage(), e);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.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/report/CoreHtmlReport.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/CoreHtmlReport.java Wed Aug  7 11:35:42 2013
@@ -48,7 +48,9 @@ public class CoreHtmlReport extends Abst
     public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer)
             throws IOException {
         stackTraceCounter = 0;
-        revision = parameters.get(AbstractRunner.TCK_REVISION_PARAMETER);
+        if (parameters != null) {
+            revision = parameters.get(AbstractRunner.TCK_REVISION_PARAMETER);
+        }
 
         writer.write("<h1>OpenCMIS TCK Report</h1>\n");
         writer.write((new Date()) + "\n");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/BaseTypesTest.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/tests/types/BaseTypesTest.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/BaseTypesTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/BaseTypesTest.java Wed Aug  7 11:35:42 2013
@@ -223,12 +223,14 @@ public class BaseTypesTest extends Abstr
                     // check type children
                     Map<String, ObjectType> typeChilden = new HashMap<String, ObjectType>();
                     for (ObjectType childType : reloadedTypeChildren) {
-                        addResult(checkTypeDefinition(session, childType, "Type spec compliance: "
-                                + (childType == null ? "?" : childType.getId())));
-
-                        if (childType != null) {
-                            typeChilden.put(childType.getId(), childType);
+                        if (childType == null) {
+                            addResult(createResult(FAILURE, "The list of types contains a null entry!"));
+                            continue;
                         }
+
+                        addResult(checkTypeDefinition(session, childType, "Type spec compliance: " + childType.getId()));
+
+                        typeChilden.put(childType.getId(), childType);
                     }
 
                     // compare type children and type descendants

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/CheckedOutTest.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/tests/versioning/CheckedOutTest.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/CheckedOutTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/CheckedOutTest.java Wed Aug  7 11:35:42 2013
@@ -114,34 +114,37 @@ public class CheckedOutTest extends Abst
         String lastName = null;
 
         for (Document pwc : pwcs) {
+            if (pwc == null) {
+                addResult(createResult(FAILURE, "The list of checked out documents contains a null entry!"));
+                continue;
+            }
+
             String[] propertiesToCheck = getAllProperties(pwc);
-            addResult(checkObject(session, pwc, propertiesToCheck, "PWC check: " + (pwc == null ? "?" : pwc.getId())));
+            addResult(checkObject(session, pwc, propertiesToCheck, "PWC check: " + pwc.getId()));
 
-            if (pwc != null) {
-                if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) {
-                    f = createResult(WARNING, "PWC is not the latest version! Id: " + pwc.getId()
-                            + " (Note: The words of the CMIS specification define that the PWC is the latest version."
-                            + " But that is not the intention of the spec and will be changed in CMIS 1.1."
-                            + " Thus this a warning, not an error.)");
-                    addResult(assertIsTrue(pwc.isLatestVersion(), null, f));
-                } else {
-                    f = createResult(FAILURE, "The property value of 'cmis:isLatestVersion' is TRUE for a PWC! Id: "
-                            + pwc.getId());
-                    addResult(assertIsFalse(pwc.isLatestVersion(), null, f));
-                    f = createResult(FAILURE,
-                            "The property value of 'cmis:isLatestMajorVersion' is TRUE for a PWC! Id: " + pwc.getId());
-                    addResult(assertIsFalse(pwc.isLatestMajorVersion(), null, f));
-                }
+            if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) {
+                f = createResult(WARNING, "PWC is not the latest version! Id: " + pwc.getId()
+                        + " (Note: The words of the CMIS specification define that the PWC is the latest version."
+                        + " But that is not the intention of the spec and will be changed in CMIS 1.1."
+                        + " Thus this a warning, not an error.)");
+                addResult(assertIsTrue(pwc.isLatestVersion(), null, f));
+            } else {
+                f = createResult(FAILURE,
+                        "The property value of 'cmis:isLatestVersion' is TRUE for a PWC! Id: " + pwc.getId());
+                addResult(assertIsFalse(pwc.isLatestVersion(), null, f));
+                f = createResult(FAILURE, "The property value of 'cmis:isLatestMajorVersion' is TRUE for a PWC! Id: "
+                        + pwc.getId());
+                addResult(assertIsFalse(pwc.isLatestMajorVersion(), null, f));
+            }
 
-                if (lastName != null && pwc.getName() != null) {
-                    if (pwc.getName().compareToIgnoreCase(lastName) < 0) {
-                        orderByNameIssues++;
-                    }
+            if (lastName != null && pwc.getName() != null) {
+                if (pwc.getName().compareToIgnoreCase(lastName) < 0) {
+                    orderByNameIssues++;
                 }
-
-                lastName = pwc.getName();
             }
 
+            lastName = pwc.getName();
+
             i++;
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java Wed Aug  7 11:35:42 2013
@@ -42,7 +42,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
 import org.apache.chemistry.opencmis.commons.spi.RepositoryService;
 import org.apache.chemistry.opencmis.tools.filecopy.FileCopier;
-import org.apache.chemistry.opencmis.tools.mapper.PropertyMapperExif;
 import org.apache.chemistry.opencmis.util.repository.MultiThreadedObjectGenerator;
 import org.apache.chemistry.opencmis.util.repository.ObjectGenerator;
 import org.apache.chemistry.opencmis.util.repository.ObjectGenerator.CONTENT_KIND;
@@ -64,7 +63,7 @@ public class ObjGenApp {
     private static final String PROP_CUSTOM = "org.apache.chemistry.opencmis.binding.header.";
     private static final String DEFAULT_ATOMPUB_URL = "http://localhost:8080/inmemory/atom";
     private static final String DEFAULT_WS_URL = "http://localhost:8080/inmemory/services/";
-    private static final String DEFAULT_BROWSER_BINDING_URL  = "http://localhost:8080/inmemory/browser/";
+    private static final String DEFAULT_BROWSER_BINDING_URL = "http://localhost:8080/inmemory/browser/";
     private static final String DEFAULT_BINDING = "atompub";
     private static final String CMD = "Command";
     private static final String REPOSITORY_ID = "RepositoryId";
@@ -90,7 +89,7 @@ public class ObjGenApp {
     BindingType fBindingType;
     private CONTENT_KIND fContentKind;
     CmisBinding binding;
-    
+
     OptionSpec<String> fCmd;
     OptionSpec<Integer> fDepth;
     OptionSpec<Integer> fContentSize;
@@ -108,7 +107,7 @@ public class ObjGenApp {
     OptionSpec<String> fFileNamePattern;
     OptionSpec<String> fLocalDir;
     OptionSpec<String> fLocalFile;
-    
+
     public static void main(String[] args) {
 
         ObjGenApp app = new ObjGenApp();
@@ -129,31 +128,32 @@ public class ObjGenApp {
         OptionParser parser = new OptionParser();
         fCmd = parser.accepts(CMD).withRequiredArg().describedAs("Command to perform (see below)");
         fRepoId = parser.accepts(REPOSITORY_ID).withOptionalArg().describedAs("Repository used");
-        fDocType = parser.accepts(FILLER_DOCUMENT_TYPE_ID).withOptionalArg().defaultsTo(
-                BaseTypeId.CMIS_DOCUMENT.value()).describedAs("Document type created");
+        fDocType = parser.accepts(FILLER_DOCUMENT_TYPE_ID).withOptionalArg()
+                .defaultsTo(BaseTypeId.CMIS_DOCUMENT.value()).describedAs("Document type created");
         fFolderType = parser.accepts(FILLER_FOLDER_TYPE_ID).withOptionalArg()
                 .defaultsTo(BaseTypeId.CMIS_FOLDER.value()).describedAs("Folder type created");
-        fDocsPerFolder = parser.accepts(FILLER_DOCS_PER_FOLDER).withOptionalArg().ofType(Integer.class).describedAs(
-                "Documents on each level").defaultsTo(1);
+        fDocsPerFolder = parser.accepts(FILLER_DOCS_PER_FOLDER).withOptionalArg().ofType(Integer.class)
+                .describedAs("Documents on each level").defaultsTo(1);
         fFolderPerFolder = parser.accepts(FILLER_FOLDERS_PER_FOLDER).withOptionalArg().ofType(Integer.class)
                 .describedAs(" Folders on each level").defaultsTo(0);
         fDepth = parser.accepts(FILLER_DEPTH).withOptionalArg().ofType(Integer.class).describedAs("Levels of folders")
                 .defaultsTo(1);
-        fContentSize = parser.accepts(FILLER_CONTENT_SIZE).withOptionalArg().ofType(Integer.class).describedAs(
-                "Content size of each doc").defaultsTo(0);
-        fCount = parser.accepts(COUNT).withOptionalArg().ofType(Integer.class).defaultsTo(1).describedAs(
-                "Repeat a command n times (partially implemented)");
-        fCleanup = parser.accepts(CLEANUP).withOptionalArg().ofType(Boolean.class).defaultsTo(false).describedAs(
-                "Clean all created objects at the end");
-        fRootFolder = parser.accepts(ROOTFOLDER).withOptionalArg().ofType(String.class).describedAs(
-                "folder id used as root to create objects (default repository root folder)");
-        fThreads = parser.accepts(THREADS).withOptionalArg().ofType(Integer.class).defaultsTo(1).describedAs(
-                "Number of threads to start in parallel");
-//        fFileName = parser.accepts(FILE).withRequiredArg().ofType(String.class).describedAs("Input File");
+        fContentSize = parser.accepts(FILLER_CONTENT_SIZE).withOptionalArg().ofType(Integer.class)
+                .describedAs("Content size of each doc").defaultsTo(0);
+        fCount = parser.accepts(COUNT).withOptionalArg().ofType(Integer.class).defaultsTo(1)
+                .describedAs("Repeat a command n times (partially implemented)");
+        fCleanup = parser.accepts(CLEANUP).withOptionalArg().ofType(Boolean.class).defaultsTo(false)
+                .describedAs("Clean all created objects at the end");
+        fRootFolder = parser.accepts(ROOTFOLDER).withOptionalArg().ofType(String.class)
+                .describedAs("folder id used as root to create objects (default repository root folder)");
+        fThreads = parser.accepts(THREADS).withOptionalArg().ofType(Integer.class).defaultsTo(1)
+                .describedAs("Number of threads to start in parallel");
+        // fFileName =
+        // parser.accepts(FILE).withRequiredArg().ofType(String.class).describedAs("Input File");
         fContentKindStr = parser.accepts(CONTENT_KIND).withOptionalArg().ofType(String.class).defaultsTo("lorem/text")
                 .describedAs("kind of content: static/text, lorem/text, lorem/html, fractal/jpeg");
-        fFileNamePattern = parser.accepts(FILE_NAME_PATTERN).withOptionalArg().ofType(String.class).defaultsTo("ContentData-%03d.bin")
-                .describedAs("file name pattern to be used with CreateFiles action");
+        fFileNamePattern = parser.accepts(FILE_NAME_PATTERN).withOptionalArg().ofType(String.class)
+                .defaultsTo("ContentData-%03d.bin").describedAs("file name pattern to be used with CreateFiles action");
         fLocalDir = parser.accepts(LOCAL_DIR).withOptionalArg().ofType(String.class).defaultsTo(".")
                 .describedAs("name of a directory to be recursively copied to the repository");
         fLocalFile = parser.accepts(LOCAL_FILE).withOptionalArg().ofType(String.class)
@@ -165,7 +165,7 @@ public class ObjGenApp {
         }
 
         String binding = getBinding();
-        
+
         if (binding.equals(BINDING_WS)) {
             fBindingType = BindingType.WEBSERVICES;
         } else if (binding.equals(BINDING_ATOM)) {
@@ -173,17 +173,18 @@ public class ObjGenApp {
         } else if (binding.equals(BINDING_BROWSER)) {
             fBindingType = BindingType.BROWSER;
         } else {
-            System.out.println("Error: Unknown binding: " + binding + " allowed values: "
-                    + BINDING_WS + " or " + BINDING_ATOM + " or " + BINDING_BROWSER);
+            System.out.println("Error: Unknown binding: " + binding + " allowed values: " + BINDING_WS + " or "
+                    + BINDING_ATOM + " or " + BINDING_BROWSER);
             return;
         }
 
         String kind = options.valueOf(fContentKindStr);
         if (null == kind) {
-            if (options.valueOf(fContentSize) > 0)
+            if (options.valueOf(fContentSize) > 0) {
                 fContentKind = ObjectGenerator.CONTENT_KIND.StaticText;
-            else
+            } else {
                 fContentKind = null;
+            }
         } else if (kind.equals("static/text"))
             fContentKind = ObjectGenerator.CONTENT_KIND.StaticText;
         else if (kind.equals("lorem/text"))
@@ -209,8 +210,8 @@ public class ObjGenApp {
             createFolders(options);
         } else if (options.valueOf(fCmd).equals("RepositoryInfo")) {
             repositoryInfo(options);
-//        } else if (options.valueOf(fCmd).equals("CreateTypes")) {
-//            createTypes(options);
+            // } else if (options.valueOf(fCmd).equals("CreateTypes")) {
+            // createTypes(options);
         } else if (options.valueOf(fCmd).equals("CreateFiles")) {
             createFiles(options);
         } else if (options.valueOf(fCmd).equals("CopyFiles")) {
@@ -245,17 +246,20 @@ public class ObjGenApp {
             System.out.println("Usage:");
             parser.printHelpOn(System.out);
             System.out.println();
-            System.out.println("Command is one of [CreateDocument, CreateFolder, FillRepository, RepositoryInfo, CreateFiles, " +
-            		"CopyFiles, CopyFilesTest]");
-            System.out.println("JVM system properties: " + PROP_ATOMPUB_URL + ", " + PROP_WS_URL + ", " + PROP_BROWSER_URL);
+            System.out
+                    .println("Command is one of [CreateDocument, CreateFolder, FillRepository, RepositoryInfo, CreateFiles, "
+                            + "CopyFiles, CopyFilesTest]");
+            System.out.println("JVM system properties: " + PROP_ATOMPUB_URL + ", " + PROP_WS_URL + ", "
+                    + PROP_BROWSER_URL);
             System.out.println("                       " + PROP_USER + ", " + PROP_PASSWORD);
             System.out.println();
             System.out.println("Example: ");
-            System.out.println("java -D"
-                    + PROP_ATOMPUB_URL
-                    + "=http://localhost:8080/opencmis/atom -cp ... "
-                    + "org.apache.chemistry.opencmis.util.repository.ObjGenApp --Binding=AtomPub --Command=CreateDocument "
-                    + "--RepositoryId=A1 --ContentSizeInKB=25 --ContentKind=lorem/text");
+            System.out
+                    .println("java -D"
+                            + PROP_ATOMPUB_URL
+                            + "=http://localhost:8080/opencmis/atom -cp ... "
+                            + "org.apache.chemistry.opencmis.util.repository.ObjGenApp --Binding=AtomPub --Command=CreateDocument "
+                            + "--RepositoryId=A1 --ContentSizeInKB=25 --ContentKind=lorem/text");
             return;
         } catch (IOException e) {
             e.printStackTrace();
@@ -290,8 +294,8 @@ public class ObjGenApp {
 
         // Step 2: fill each root folder with an object tree
         MultiThreadedObjectGenerator.ObjectGeneratorRunner[] runners = MultiThreadedObjectGenerator
-                .prepareForCreateTreeMT(getClientBindings(), repoId, docsPerFolder, foldersPerFolders, depth, documentType,
-                        folderType, contentSizeInKB, folderIds, fContentKind, doCleanup);
+                .prepareForCreateTreeMT(getClientBindings(), repoId, docsPerFolder, foldersPerFolders, depth,
+                        documentType, folderType, contentSizeInKB, folderIds, fContentKind, doCleanup);
 
         MultiThreadedObjectGenerator.runMultiThreaded(runners);
         System.out.println("Filling repository succeeded.");
@@ -304,8 +308,9 @@ public class ObjGenApp {
             System.out.println("Using WebService, connecting to  " + getWsUrl());
         } else if (fBindingType == BindingType.BROWSER) {
             System.out.println("Using Browser binding, connecting to  " + getBrowserUrl());
-        } else
+        } else {
             System.out.println("Unknown binding type.");
+        }
 
         System.out.println("Repository id is: " + options.valueOf(fRepoId));
         System.out.println("Content size: " + options.valueOf(fContentSize));
@@ -326,9 +331,9 @@ public class ObjGenApp {
             createSingleDocument(options.valueOf(fRepoId), options.valueOf(fDocType), options.valueOf(fContentSize),
                     options.valueOf(fRootFolder), options.valueOf(fCount), options.valueOf(fCleanup));
         } else {
-            createSingleDocumentMT(noThreads, options.valueOf(fRepoId), options.valueOf(fDocType), options
-                    .valueOf(fContentSize), options.valueOf(fRootFolder), options.valueOf(fCount), options
-                    .valueOf(fCleanup));
+            createSingleDocumentMT(noThreads, options.valueOf(fRepoId), options.valueOf(fDocType),
+                    options.valueOf(fContentSize), options.valueOf(fRootFolder), options.valueOf(fCount),
+                    options.valueOf(fCleanup));
         }
     }
 
@@ -344,14 +349,14 @@ public class ObjGenApp {
         int noThreads = options.valueOf(fThreads);
         if (noThreads <= 1) {
             fillRepository(options.valueOf(fRepoId), options.valueOf(fDocsPerFolder),
-                    options.valueOf(fFolderPerFolder), options.valueOf(fDepth), options.valueOf(fDocType), options
-                            .valueOf(fFolderType), options.valueOf(fContentSize), options.valueOf(fRootFolder), options
-                            .valueOf(fCleanup));
+                    options.valueOf(fFolderPerFolder), options.valueOf(fDepth), options.valueOf(fDocType),
+                    options.valueOf(fFolderType), options.valueOf(fContentSize), options.valueOf(fRootFolder),
+                    options.valueOf(fCleanup));
         } else {
-            fillRepositoryMT(noThreads, options.valueOf(fRepoId), options.valueOf(fDocsPerFolder), options
-                    .valueOf(fFolderPerFolder), options.valueOf(fDepth), options.valueOf(fDocType), options
-                    .valueOf(fFolderType), options.valueOf(fContentSize), options.valueOf(fRootFolder), options
-                    .valueOf(fCleanup));
+            fillRepositoryMT(noThreads, options.valueOf(fRepoId), options.valueOf(fDocsPerFolder),
+                    options.valueOf(fFolderPerFolder), options.valueOf(fDepth), options.valueOf(fDocType),
+                    options.valueOf(fFolderType), options.valueOf(fContentSize), options.valueOf(fRootFolder),
+                    options.valueOf(fCleanup));
         }
 
     }
@@ -363,11 +368,11 @@ public class ObjGenApp {
         System.out.println("Folder Type: " + options.valueOf(fFolderType));
         int noThreads = options.valueOf(fThreads);
         if (noThreads <= 1) {
-            createFolders(options.valueOf(fRepoId), options.valueOf(fFolderType), options.valueOf(fRootFolder), options
-                    .valueOf(fCount), options.valueOf(fCleanup));
+            createFolders(options.valueOf(fRepoId), options.valueOf(fFolderType), options.valueOf(fRootFolder),
+                    options.valueOf(fCount), options.valueOf(fCleanup));
         } else {
-            createFoldersMT(noThreads, options.valueOf(fRepoId), options.valueOf(fFolderType), options
-                    .valueOf(fRootFolder), options.valueOf(fCount), options.valueOf(fCleanup));
+            createFoldersMT(noThreads, options.valueOf(fRepoId), options.valueOf(fFolderType),
+                    options.valueOf(fRootFolder), options.valueOf(fCount), options.valueOf(fCleanup));
         }
     }
 
@@ -375,8 +380,8 @@ public class ObjGenApp {
             int docCount, boolean doCleanup) {
 
         MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator
-                .prepareForCreateDocument(getClientBindings(), repoId, documentType, contentSizeInKB, rootFolderId, docCount,
-                        fContentKind, doCleanup);
+                .prepareForCreateDocument(getClientBindings(), repoId, documentType, contentSizeInKB, rootFolderId,
+                        docCount, fContentKind, doCleanup);
         ObjectGenerator gen = runner.getObjectGenerator();
         String[] ids = runner.doCreateDocument();
         System.out.println();
@@ -451,32 +456,6 @@ public class ObjGenApp {
         timeLogger.printTimes();
     }
 
-    private void createTypes(OptionSet options) {
-
-        String repoId = options.valueOf(fRepoId);
-        String fileName = options.valueOf(fFileName);
-        System.out.println();
-        System.out.println("Not yet implemented waiting for CMIS 1.1!");
-//        System.out.println("Creating types from file:");
-//        System.out.println("File Name: " + fileName);
-//        System.out.println("Repository Id: " + repoId);
-//
-//        File file = new File(options.valueOf(fFileName));
-//        TypeDefinitionList typeDefs = null;
-//
-//        try {
-//            Unmarshaller u = JaxBHelper.createUnmarshaller();
-//            JAXBElement<CmisTypeDefinitionListType> type = (JAXBElement<CmisTypeDefinitionListType>) u.unmarshal(file);
-//            typeDefs = Converter.convert(type.getValue());
-//        } catch (Exception e) {
-//            System.out.println("Could not load type: '" + fFileName + "': " + e);
-//        }
-//        MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator.prepareForCreateTypes(
-//                getBinding(), repoId, typeDefs);
-//        ObjectGenerator gen = runner.getObjectGenerator();
-//        gen.createTypes(typeDefs);
-    }
-        
     private void repositoryInfo(OptionSet options) {
         callRepoInfo(options.valueOf(fRepoId), options.valueOf(fCount));
     }
@@ -486,22 +465,22 @@ public class ObjGenApp {
         String fileNamePattern = options.valueOf(fFileNamePattern);
         int count = options.valueOf(fCount);
         int contentSize = options.valueOf(fContentSize);
-        
+
         System.out.println("Creating local files with content: ");
         System.out.println("Kind: " + options.valueOf(fDocsPerFolder));
         System.out.println("Number of files: " + count);
         System.out.println("File name pattern: " + fileNamePattern);
         System.out.println("Kind of content: " + options.valueOf(fContentKindStr));
         System.out.println("Size of content (text only): " + contentSize);
-        
+
         ObjectGenerator objGen = new ObjectGenerator(null, null, null, null, null, fContentKind);
         objGen.setContentSizeInKB(contentSize);
-        
+
         InputStream is = null;
         FileOutputStream os = null;
-        
+
         try {
-            for (int i=0; i<count; i++) {
+            for (int i = 0; i < count; i++) {
                 String fileName = String.format(fileNamePattern, i);
                 System.out.println("Generating file: " + fileName);
                 if (contentSize > 0) {
@@ -510,24 +489,25 @@ public class ObjGenApp {
                         contentStream = objGen.createContentStaticText();
                         break;
                     case LoremIpsumText:
-                        contentStream =  objGen.createContentLoremIpsumText();
+                        contentStream = objGen.createContentLoremIpsumText();
                         break;
                     case LoremIpsumHtml:
-                        contentStream =  objGen.createContentLoremIpsumHtml();
+                        contentStream = objGen.createContentLoremIpsumHtml();
                         break;
                     case ImageFractalJpeg:
-                        contentStream =  objGen.createContentFractalimageJpeg();
+                        contentStream = objGen.createContentFractalimageJpeg();
                         break;
                     }
                 }
 
                 // write to a file:
                 is = contentStream.getStream();
-                os = new FileOutputStream (fileName);
-                byte[] b = new byte[64 * 1024];  
-                int read;  
-                while ((read = is.read(b)) != -1)   
-                    os.write(b, 0, read);  
+                os = new FileOutputStream(fileName);
+                byte[] b = new byte[64 * 1024];
+                int read;
+                while ((read = is.read(b)) != -1) {
+                    os.write(b, 0, read);
+                }
                 is.close();
                 is = null;
                 os.close();
@@ -538,12 +518,14 @@ public class ObjGenApp {
             e.printStackTrace();
         } finally {
             try {
-                if (null != is)
-                        is.close();
-                if (null != os)
+                if (null != is) {
+                    is.close();
+                }
+                if (null != os) {
                     os.close();
+                }
             } catch (IOException e) {
-            }            
+            }
         }
     }
 
@@ -553,16 +535,17 @@ public class ObjGenApp {
         String repoId = options.valueOf(fRepoId);
         String folderId = options.valueOf(fRootFolder);
         String name = fileName;
-        
+
         if ((null == fileName || fileName.length() == 0) && (null == dirName || dirName.length() == 0)) {
             System.out.println("Error: You either have to provide a --file or a --dir option to copy file(s).");
             return;
         }
-        
+
         // if no file name is provided there must be a directory
-        if (null == name || name.length() == 0)
+        if (null == name || name.length() == 0) {
             name = dirName;
-        
+        }
+
         if (null == repoId || repoId.length() == 0) {
             System.out.println("Error: You have to provide a repository id");
             return;
@@ -570,24 +553,23 @@ public class ObjGenApp {
         System.out.println("Copying files to a repository: ");
         System.out.println("Repository id is: " + repoId);
         System.out.println("Folder id used as root: " + options.valueOf(fRootFolder));
-        
-        
+
         Map<String, String> parameters = getConnectionParameters(getBinding(), repoId);
         FileCopier fc = new FileCopier();
         fc.connect(parameters);
         fc.copyRecursive(name, folderId);
     }
-        
+
     private void transferFilesTest(OptionSet options) {
         String fileName = options.valueOf(fLocalFile);
-        
+
         if ((null == fileName || fileName.length() == 0)) {
             System.out.println("Error: You have to provide a --file option to test metadata extraction.");
             return;
         }
-        
+
         System.out.println("Testing metadata extraction: ");
-        
+
         FileCopier fc = new FileCopier();
         fc.listMetadata(fileName);
     }
@@ -617,11 +599,12 @@ public class ObjGenApp {
         if (binding == null) {
             if (fBindingType == BindingType.ATOMPUB) {
                 binding = createAtomBinding(getAtomPubUrl(), getUser(), getPassword());
-            } if (fBindingType == BindingType.WEBSERVICES) {
+            }
+            if (fBindingType == BindingType.WEBSERVICES) {
                 String url = getWsUrl();
-                binding = createWSBinding(url, isPrefix(url), getUser(), getPassword()); 
+                binding = createWSBinding(url, isPrefix(url), getUser(), getPassword());
             } else if (fBindingType == BindingType.BROWSER) {
-                binding = createBrowserBinding(getBrowserUrl(), getUser(), getPassword()); 
+                binding = createBrowserBinding(getBrowserUrl(), getUser(), getPassword());
             }
         }
         return binding;
@@ -635,12 +618,12 @@ public class ObjGenApp {
             parameters.put(SessionParameter.PASSWORD, password);
         }
     }
-    
+
     private static void fillCustomHeaders(Map<String, String> parameters) {
-    	Map<String, String> customHeaders = getCustomHeaders();
-    	for (Map.Entry<String, String> entry : customHeaders.entrySet()) {
-    		parameters.put(entry.getKey(), entry.getValue());    		
-    	}    		
+        Map<String, String> customHeaders = getCustomHeaders();
+        for (Map.Entry<String, String> entry : customHeaders.entrySet()) {
+            parameters.put(entry.getKey(), entry.getValue());
+        }
     }
 
     private static CmisBinding createAtomBinding(String url, String user, String password) {
@@ -684,20 +667,21 @@ public class ObjGenApp {
         }
         return isPrefix;
     }
-    
+
     public static CmisBinding createWSBinding(String url, boolean isPrefix, String username, String password) {
         Map<String, String> parameters = new HashMap<String, String>();
         fillWSParameters(parameters, url, isPrefix, username, password);
         fillCustomHeaders(parameters);
-        
+
         // get factory and create provider
         CmisBindingFactory factory = CmisBindingFactory.newInstance();
         CmisBinding binding = factory.createCmisWebServicesBinding(parameters);
 
         return binding;
     }
-    
-    public static void fillWSParameters(Map<String, String> parameters, String url, boolean isPrefix, String username, String password) {
+
+    public static void fillWSParameters(Map<String, String> parameters, String url, boolean isPrefix, String username,
+            String password) {
         // gather parameters
         parameters.put(SessionParameter.USER, username);
         parameters.put(SessionParameter.PASSWORD, password);
@@ -728,7 +712,7 @@ public class ObjGenApp {
     private static String getBinding() {
         return System.getProperty(PROP_BINDING, DEFAULT_BINDING);
     }
-    
+
     private static String getAtomPubUrl() {
         return System.getProperty(PROP_ATOMPUB_URL, DEFAULT_ATOMPUB_URL);
     }
@@ -750,25 +734,28 @@ public class ObjGenApp {
     }
 
     private static Map<String, String> getCustomHeaders() {
-    	int i=0;
-    	Map<String, String> customHeaders = new HashMap<String, String>();
-    	while (true) {
-    		String val = System.getProperty(PROP_CUSTOM + i, null);
-    		if (null == val)
-    			break;
-    		else {
-    			customHeaders.put(PROP_CUSTOM + i++, val);
-//    			int posCol = val.indexOf(':');
-//    			if (posCol <= 0) {
-//    				LOG.warn("Ignoring custom header "+ val + ": no colon found.");
-//    			} else {
-//    				String headerKey = PROP_CUSTOM + val.substring(0, posCol).trim();
-//    				String headerVal = val.substring(posCol+1).trim();
-//    				LOG.debug("Adding custom header " + headerKey + ":" + headerVal);
-//    				customHeaders.put(headerKey, headerVal);
-//    			}
-    		}
-    	}
+        int i = 0;
+        Map<String, String> customHeaders = new HashMap<String, String>();
+        while (true) {
+            String val = System.getProperty(PROP_CUSTOM + i, null);
+            if (null == val) {
+                break;
+            } else {
+                customHeaders.put(PROP_CUSTOM + i++, val);
+                // int posCol = val.indexOf(':');
+                // if (posCol <= 0) {
+                // LOG.warn("Ignoring custom header "+ val +
+                // ": no colon found.");
+                // } else {
+                // String headerKey = PROP_CUSTOM + val.substring(0,
+                // posCol).trim();
+                // String headerVal = val.substring(posCol+1).trim();
+                // LOG.debug("Adding custom header " + headerKey + ":" +
+                // headerVal);
+                // customHeaders.put(headerKey, headerVal);
+                // }
+            }
+        }
         return customHeaders;
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java?rev=1511250&r1=1511249&r2=1511250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java Wed Aug  7 11:35:42 2013
@@ -1,6 +1,5 @@
 /*
- * Li
-censed to the Apache Software Foundation (ASF) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
@@ -22,38 +21,40 @@ package org.apache.chemistry.opencmis.to
 import java.util.Properties;
 
 public abstract class AbstractPropertyMapper implements PropertyMapper {
-    
-    private static String DEFAULT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
+
+    private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
 
     protected String[] contentTypes;
     protected String cmisTypeId;
     protected String propPrefix;
-    protected String dateFormat = DEFAULT_DATE_FORMAT;    
+    protected String dateFormat = DEFAULT_DATE_FORMAT;
 
     public boolean initialize(String cfgPrefix, String typeKey, Properties properties) {
         propPrefix = cfgPrefix + "." + typeKey;
-        cmisTypeId =   properties.getProperty(propPrefix + ".typeId");
+        cmisTypeId = properties.getProperty(propPrefix + ".typeId");
         String contentTypeEntry = properties.getProperty(propPrefix);
-         
+
         contentTypes = contentTypeEntry.split("\\:");
-        for (int i=0; i<contentTypes.length; i++) {
+        for (int i = 0; i < contentTypes.length; i++) {
             contentTypes[i] = contentTypes[i].trim();
         }
 
         String df = properties.getProperty(propPrefix + ".dateFormat");
-        if (null!=df)
+        if (null != df) {
             dateFormat = df;
-                
-        if (null == cmisTypeId) 
+        }
+
+        if (null == cmisTypeId) {
             throw new MapperException("Missingt type id in properties: " + propPrefix + ".typeId");
-        
+        }
+
         return true;
     }
 
     public String getMappedTypeId() {
         return cmisTypeId;
     }
-    
+
     public String[] getContentTypes() {
         return contentTypes;
     }



Mime
View raw message