You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2012/08/15 16:07:57 UTC

svn commit: r1373426 [3/4] - in /chemistry/opencmis/trunk: ./ chemistry-opencmis-test/chemistry-opencmis-test-client/ chemistry-opencmis-test/chemistry-opencmis-test-tools/ chemistry-opencmis-test/chemistry-opencmis-test-tools/resources/ chemistry-open...

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/GenSpecExamples.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/GenSpecExamples.bat?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/GenSpecExamples.bat (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/GenSpecExamples.bat Wed Aug 15 14:07:56 2012
@@ -0,0 +1,5 @@
+@echo OFF
+set JAVA_HOME=D:\Java\jdk1.6.0_22-x64
+set PATH=%JAVA_HOME%\bin;%PATH%
+call cp.bat
+java -cp %CP% org.apache.chemistry.opencmis.tools.specexamples.Main

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/cp.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/cp.bat?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/cp.bat (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/cp.bat Wed Aug 15 14:07:56 2012
@@ -0,0 +1,62 @@
+set VER=0.8.0-SNAPSHOT
+set M2_REPO=d:\java\maven-repository
+set CP=target\classes;^
+%M2_REPO%/javax/activation/activation/1.1/activation-1.1.jar;^ 
+%M2_REPO%/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar;^ 
+%M2_REPO%/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar;^ 
+%M2_REPO%/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar;^ 
+%M2_REPO%/javax/xml/stream/stax-api/1.0/stax-api-1.0.jar;^ 
+%M2_REPO%/org/apache/james/apache-mime4j-core/0.7/apache-mime4j-core-0.7.jar;^ 
+%M2_REPO%/org/apache/james/apache-mime4j-dom/0.7/apache-mime4j-dom-0.7.jar;^ 
+%M2_REPO%/asm/asm/3.1/asm-3.1.jar;^ 
+%M2_REPO%/org/bouncycastle/bcmail-jdk15/1.45/bcmail-jdk15-1.45.jar;^ 
+%M2_REPO%/org/bouncycastle/bcprov-jdk15/1.45/bcprov-jdk15-1.45.jar;^ 
+%M2_REPO%/de/l3s/boilerpipe/boilerpipe/1.1.0/boilerpipe-1.1.0.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-client-api/%VER%/chemistry-opencmis-client-api-%VER%.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-client-bindings/%VER%/chemistry-opencmis-client-bindings-%VER%.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-client-impl/%VER%/chemistry-opencmis-client-impl-%VER%.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-commons-api/%VER%/chemistry-opencmis-commons-api-%VER%.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-commons-impl/%VER%/chemistry-opencmis-commons-impl-%VER%.jar;^ 
+%M2_REPO%/org/apache/chemistry/opencmis/chemistry-opencmis-test-util/%VER%/chemistry-opencmis-test-util-%VER%.jar;^ 
+%M2_REPO%/commons-codec/commons-codec/1.5/commons-codec-1.5.jar;^ 
+%M2_REPO%/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar;^ 
+%M2_REPO%/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar;^
+%M2_REPO%/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar;^ 
+%M2_REPO%/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar;^ 
+%M2_REPO%/org/apache/pdfbox/fontbox/1.6.0/fontbox-1.6.0.jar;^ 
+%M2_REPO%/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar;^ 
+%M2_REPO%/com/googlecode/mp4parser/isoparser/1.0-beta-5/isoparser-1.0-beta-5.jar;^ 
+%M2_REPO%/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar;^
+%M2_REPO%/com/sun/xml/bind/jaxb-impl/2.1.11/jaxb-impl-2.1.11.jar;^ 
+%M2_REPO%/com/sun/xml/ws/jaxws-rt/2.1.7/jaxws-rt-2.1.7.jar;^ 
+%M2_REPO%/jdom/jdom/1.0/jdom-1.0.jar;^ 
+%M2_REPO%/org/apache/pdfbox/jempbox/1.6.0/jempbox-1.6.0.jar;^ 
+%M2_REPO%/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar;^ 
+%M2_REPO%/junit/junit/4.7/junit-4.7.jar;^ 
+%M2_REPO%/log4j/log4j/1.2.16/log4j-1.2.16.jar;^
+%M2_REPO%/com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar;^ 
+%M2_REPO%/org/jvnet/mimepull/1.3/mimepull-1.3.jar;^ 
+%M2_REPO%/edu/ucar/netcdf/4.2-min/netcdf-4.2-min.jar;^ 
+%M2_REPO%/org/apache/felix/org.osgi.core/1.0.0/org.osgi.core-1.0.0.jar;^
+%M2_REPO%/org/apache/pdfbox/pdfbox/1.6.0/pdfbox-1.6.0.jar;^ 
+%M2_REPO%/org/apache/poi/poi/3.8-beta5/poi-3.8-beta5.jar;^ 
+%M2_REPO%/org/apache/poi/poi-ooxml/3.8-beta5/poi-ooxml-3.8-beta5.jar;^ 
+%M2_REPO%/org/apache/poi/poi-ooxml-schemas/3.8-beta5/poi-ooxml-schemas-3.8-beta5.jar;^
+%M2_REPO%/org/apache/poi/poi-scratchpad/3.8-beta5/poi-scratchpad-3.8-beta5.jar;^ 
+%M2_REPO%/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar;^ 
+%M2_REPO%/rome/rome/0.9/rome-0.9.jar;^ 
+%M2_REPO%/com/sun/xml/messaging/saaj/saaj-impl/1.3.3/saaj-impl-1.3.3.jar;^ 
+%M2_REPO%/net/sf/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar;^ 
+%M2_REPO%/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar;^ 
+%M2_REPO%/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar;^
+%M2_REPO%/stax/stax-api/1.0.1/stax-api-1.0.1.jar;^
+%M2_REPO%/org/jvnet/staxex/stax-ex/1.2/stax-ex-1.2.jar;^ 
+%M2_REPO%/com/sun/xml/stream/buffer/streambuffer/0.9/streambuffer-0.9.jar;^ 
+%M2_REPO%/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar;^ 
+%M2_REPO%/org/apache/tika/tika-core/1.1/tika-core-1.1.jar;^ 
+%M2_REPO%/org/apache/tika/tika-parsers/1.1/tika-parsers-1.1.jar;^ 
+%M2_REPO%/org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1-tests.jar;^
+%M2_REPO%/org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1.jar;^ 
+%M2_REPO%/org/gagravarr/vorbis-java-tika/0.1/vorbis-java-tika-0.1.jar;^ 
+%M2_REPO%/org/codehaus/woodstox/wstx-asl/3.2.3/wstx-asl-3.2.3.jar;^ 
+%M2_REPO%/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar
\ No newline at end of file

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runCreate.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runCreate.bat?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runCreate.bat (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runCreate.bat Wed Aug 15 14:07:56 2012
@@ -0,0 +1,21 @@
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem
+rem   http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+call runcmd.bat --Command=CreateDocument --RepositoryId=A1 --ContentSizeInKB=25

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.bat?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.bat (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.bat Wed Aug 15 14:07:56 2012
@@ -0,0 +1,29 @@
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem
+rem   http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+set M2_REPO=d:\java\maven-repository
+set JAVA_HOME=d:\Java\jdk1.6.0_22-x64
+set PATH=%JAVA_HOME%\bin
+call cp.bat
+java -Dorg.apache.chemistry.opencmis.binding.atompub.url=http://localhost:8080/inmemory/atom ^
+-Dorg.apache.chemistry.opencmis.binding.spi.type=atompub ^
+-Dorg.apache.chemistry.opencmis.user=jens ^
+-Dorg.apache.chemistry.opencmis.password=dummy ^
+-cp %CP% org.apache.chemistry.opencmis.tools.main.ObjGenApp %*

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.sh
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.sh?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.sh (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runcmd.sh Wed Aug 15 14:07:56 2012
@@ -0,0 +1,38 @@
+
+if [ -z "$JAVA_HOME" ]; then
+  j=$(which java 2>/dev/null)
+  if [ -z "$j" ]; then
+ 	echo "Unable to locate Java!"
+    exit 1
+  else
+    JAVA="$j"
+  fi
+else
+  JAVA="$JAVA_HOME/bin/java"
+fi
+
+
+. testtool.classpath.sh
+
+JAVA_OPTS="-Dorg.apache.chemistry.opencmis.binding.atompub.url=http://localhost:8080/inmemory/atom \
+-Dorg.apache.chemistry.opencmis.binding.spi.type=atompub \
+-Dorg.apache.chemistry.opencmis.user=jens \
+-Dorg.apache.chemistry.opencmis.password=dummy"
+
+JAVA_OPTS="$JAVA_OPTS -Djava.net.useSystemProxies=true"
+
+
+if [ -n "$http_proxy" ]; then
+  HTTP_PROXY_HOST=$(echo $http_proxy | sed 's/http:\/\/\(.*\):.*/\1/')
+  HTTP_PROXY_PORT=$(echo $http_proxy | sed 's/http:\/\/.*:\(.*\)/\1/')
+  JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=$HTTP_PROXY_HOST -Dhttp.proxyPort=$HTTP_PROXY_PORT"
+fi
+
+if [ -n "$https_proxy" ]; then
+  HTTPS_PROXY_HOST=$(echo $https_proxy | sed 's/http:\/\/\(.*\):.*/\1/')
+  HTTPS_PROXY_PORT=$(echo $https_proxy | sed 's/http:\/\/.*:\(.*\)/\1/')
+  JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=$HTTPS_PROXY_HOST -Dhttps.proxyPort=$HTTPS_PROXY_PORT"
+fi
+
+echo $CP
+exec $JAVA $JAVA_OPTS -classpath $CP org.apache.chemistry.opencmis.tools.main.ObjGenApp $*

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runfill.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runfill.bat?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runfill.bat (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/runfill.bat Wed Aug 15 14:07:56 2012
@@ -0,0 +1,22 @@
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem
+rem   http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+call runcmd.bat --Command=FillRepository --RepositoryId=A1 --Depth=1 --DocsPerFolder=1 ^
+--FoldersPerFolder=0  --ContentSizeInKB=25

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/testtool.classpath.sh
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/testtool.classpath.sh?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/testtool.classpath.sh (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/testtool.classpath.sh Wed Aug 15 14:07:56 2012
@@ -0,0 +1,62 @@
+VER=0.8.0-SNAPSHOT
+M2_REPO=~/.m2/repository
+CP="target/classes:\
+$M2_REPO/javax/activation/activation/1.1/activation-1.1.jar:\
+$M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar:\
+$M2_REPO/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:\
+$M2_REPO/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:\
+$M2_REPO/javax/xml/stream/stax-api/1.0/stax-api-1.0.jar:\
+$M2_REPO/org/apache/james/apache-mime4j-core/0.7/apache-mime4j-core-0.7.jar:\
+$M2_REPO/org/apache/james/apache-mime4j-dom/0.7/apache-mime4j-dom-0.7.jar:\
+$M2_REPO/asm/asm/3.1/asm-3.1.jar:\
+$M2_REPO/org/bouncycastle/bcmail-jdk15/1.45/bcmail-jdk15-1.45.jar:\
+$M2_REPO/org/bouncycastle/bcprov-jdk15/1.45/bcprov-jdk15-1.45.jar:\
+$M2_REPO/de/l3s/boilerpipe/boilerpipe/1.1.0/boilerpipe-1.1.0.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-client-api/$VER/chemistry-opencmis-client-api-$VER.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-client-bindings/$VER/chemistry-opencmis-client-bindings-$VER.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-client-impl/$VER/chemistry-opencmis-client-impl-$VER.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-commons-api/$VER/chemistry-opencmis-commons-api-$VER.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-commons-impl/$VER/chemistry-opencmis-commons-impl-$VER.jar:\
+$M2_REPO/org/apache/chemistry/opencmis/chemistry-opencmis-test-util/$VER/chemistry-opencmis-test-util-$VER.jar:\
+$M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5.jar:\
+$M2_REPO/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar:\
+$M2_REPO/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar:\
+$M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:\
+$M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:\
+$M2_REPO/org/apache/pdfbox/fontbox/1.6.0/fontbox-1.6.0.jar:\
+$M2_REPO/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar:\
+$M2_REPO/com/googlecode/mp4parser/isoparser/1.0-beta-5/isoparser-1.0-beta-5.jar:\
+$M2_REPO/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar:\
+$M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.11/jaxb-impl-2.1.11.jar:\
+$M2_REPO/com/sun/xml/ws/jaxws-rt/2.1.7/jaxws-rt-2.1.7.jar:\
+$M2_REPO/jdom/jdom/1.0/jdom-1.0.jar:\
+$M2_REPO/org/apache/pdfbox/jempbox/1.6.0/jempbox-1.6.0.jar:\
+$M2_REPO/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar:\
+$M2_REPO/junit/junit/4.7/junit-4.7.jar:\
+$M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar:\
+$M2_REPO/com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar:\
+$M2_REPO/org/jvnet/mimepull/1.3/mimepull-1.3.jar:\
+$M2_REPO/edu/ucar/netcdf/4.2-min/netcdf-4.2-min.jar:\
+$M2_REPO/org/apache/felix/org.osgi.core/1.0.0/org.osgi.core-1.0.0.jar:\
+$M2_REPO/org/apache/pdfbox/pdfbox/1.6.0/pdfbox-1.6.0.jar:\
+$M2_REPO/org/apache/poi/poi/3.8-beta5/poi-3.8-beta5.jar:\
+$M2_REPO/org/apache/poi/poi-ooxml/3.8-beta5/poi-ooxml-3.8-beta5.jar:\
+$M2_REPO/org/apache/poi/poi-ooxml-schemas/3.8-beta5/poi-ooxml-schemas-3.8-beta5.jar:\
+$M2_REPO/org/apache/poi/poi-scratchpad/3.8-beta5/poi-scratchpad-3.8-beta5.jar:\
+$M2_REPO/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar:\
+$M2_REPO/rome/rome/0.9/rome-0.9.jar:\
+$M2_REPO/com/sun/xml/messaging/saaj/saaj-impl/1.3.3/saaj-impl-1.3.3.jar:\
+$M2_REPO/net/sf/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar:\
+$M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar:\
+$M2_REPO/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar:\
+$M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar:\
+$M2_REPO/org/jvnet/staxex/stax-ex/1.2/stax-ex-1.2.jar:\
+$M2_REPO/com/sun/xml/stream/buffer/streambuffer/0.9/streambuffer-0.9.jar:\
+$M2_REPO/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar:\
+$M2_REPO/org/apache/tika/tika-core/1.1/tika-core-1.1.jar:\
+$M2_REPO/org/apache/tika/tika-parsers/1.1/tika-parsers-1.1.jar:\
+$M2_REPO/org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1-tests.jar:\
+$M2_REPO/org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1.jar:\
+$M2_REPO/org/gagravarr/vorbis-java-tika/0.1/vorbis-java-tika-0.1.jar:\
+$M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.3/wstx-asl-3.2.3.jar:\
+$M2_REPO/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar"

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/uploadmedia.sh
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/uploadmedia.sh?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/uploadmedia.sh (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/uploadmedia.sh Wed Aug 15 14:07:56 2012
@@ -0,0 +1,2 @@
+#!/bin/sh
+. runcmd.sh --Command=CopyFiles --RepositoryId=A1 --Dir ~/mymedia
\ No newline at end of file

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/scripts/uploadmedia.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/filecopy/FileCopier.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/filecopy/FileCopier.java?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/filecopy/FileCopier.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/filecopy/FileCopier.java Wed Aug 15 14:07:56 2012
@@ -0,0 +1,242 @@
+/*
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.tools.filecopy;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.api.SessionFactory;
+import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.apache.chemistry.opencmis.tools.mapper.Configurator;
+import org.apache.chemistry.opencmis.tools.mapper.MapperException;
+import org.apache.chemistry.opencmis.tools.mapper.PropertyMapper;
+import org.apache.chemistry.opencmis.tools.parser.MetadataParser;
+import org.apache.chemistry.opencmis.tools.parser.MetadataParserTika;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.tika.Tika;
+    
+public class FileCopier {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(FileCopier.class.getName());
+    // initialize configurator to get parsers and property mappings
+    private static final Configurator CFG = Configurator.getInstance(); 
+    
+    private Session session;
+    
+    public FileCopier() {
+    }
+    
+    public void connect(Map<String, String> parameters) {
+        System.out.println("Connecting to a repository ...");
+
+        // Create a SessionFactory and set up the SessionParameter map
+        SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
+
+        session = sessionFactory.createSession(parameters);
+
+        LOG.debug("Got a connection to repository.");
+    }
+        
+    public void copyRecursive(String folderName, String folderId) {
+
+        try {
+            File fileOrDir = new File(folderName);
+            if (fileOrDir.isDirectory()) {
+                String newFolderId = createFolderInRepository(fileOrDir.getAbsolutePath(), folderId);
+                File[] children = fileOrDir.listFiles();
+                for (File file: children) {
+                    if (!file.getName().equals(".") && !file.getName().equals("..")) {
+                        copyRecursive(file.getAbsolutePath(), newFolderId);
+                    }
+                }
+            } else {
+                copyFileToRepository(fileOrDir.getAbsolutePath(), folderId);
+            }            
+        } catch (Exception e) {
+            LOG.error(e.toString(), e);
+        } finally {  
+        }
+    }
+    
+    private String copyFileToRepository(String fileName, String folderId) {
+        LOG.debug("uploading file " + fileName);
+        FileInputStream is = null;
+        Map<String, Object> properties = new HashMap<String, Object>();
+        Folder parentFolder;
+        String id = null;
+        
+        if (null == folderId)
+            parentFolder = session.getRootFolder();
+        else
+            parentFolder = (Folder) session.getObject(folderId);
+        
+        try {
+            File f = new File(fileName);
+            Tika tika = new Tika();     
+            String mimeType = tika.detect(f);
+            LOG.info("Detected MIME type: "+ mimeType);
+            
+            // extract metadata: first get a parser
+            MetadataParser parser = CFG.getParser(mimeType);
+            if (null == parser) {
+                properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
+                properties.put(PropertyIds.OBJECT_TYPE_ID, CFG.getDefaultDocumentType());
+            } else {
+                parser.reset();
+                PropertyMapper mapper = CFG.getPropertyMapper(mimeType);
+                if (null == mapper)
+                    throw new MapperException("Unknown mime type (no configuration): " + mimeType);
+                String typeId = mapper.getMappedTypeId();
+                if (null == typeId)
+                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
+                TypeDefinition td = session.getTypeDefinition(typeId);
+                if (null == td)
+                    throw new MapperException("CMIS type " + typeId + " does not exist on server.");
+
+                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
+                parser.extractMetadata(f, td);
+                properties = parser.getCmisProperties();
+            }
+                        
+            // check if there is an overridden content type configured
+            int posLastDot = f.getName().indexOf('.');
+            String ext = posLastDot < 0 ? null : f.getName().substring(posLastDot+1, f.getName().length());
+            String overridden = null;
+            if (null != ext && (overridden = CFG.getContentType(ext)) != null)
+                mimeType = overridden;
+            long length = f.length();
+            
+            is = new FileInputStream(fileName);
+
+            ContentStream contentStream = session.getObjectFactory().createContentStream(fileName,
+                    length, mimeType, is);
+            if (!properties.containsKey(PropertyIds.NAME))
+                properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
+            LOG.debug("uploading document with content lenth: " + contentStream.getLength());
+            Document doc = parentFolder.createDocument(properties, contentStream, VersioningState.NONE);
+            is.close();
+            
+            id = doc.getId();
+            LOG.info("New document created with id: " + id + ", name: " +  properties.get(PropertyIds.NAME) + " in folder: " + parentFolder.getId());
+        } catch (Exception e) {
+            LOG.error("Failed to create CMIS document.", e);
+        } finally {
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    LOG.error(e.toString(), e);
+                }
+            }
+            LOG.debug("Conversion and transfer done.");    
+        }
+        return id;
+    }
+    
+    private  String createFolderInRepository(String fileName, String parentFolderId) {
+        Folder parentFolder;
+        String id = null;
+        if (null == parentFolderId)
+            parentFolder = session.getRootFolder();
+        else
+            parentFolder = (Folder) session.getObject(parentFolderId);
+        Map<String, Object> properties = new HashMap<String, Object>();
+        File f = new File(fileName);
+        properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
+        properties.put(PropertyIds.OBJECT_TYPE_ID, CFG.getDefaultFolderType());
+        try {
+            Folder folder = parentFolder.createFolder(properties);
+            id = folder.getId();
+            LOG.debug("New folder created with id: " + folder.getId() + ", path: " + folder.getPaths().get(0));
+        } catch (Exception e) {
+            LOG.error("Failed to create CMIS document.", e);
+        } finally {
+        }
+        LOG.info("New folder created with id: " + id + ", name: " +  properties.get(PropertyIds.NAME) + " in parent folder: " + parentFolder.getId());
+        return id;
+    }
+    
+    public void listMetadata(String fileName) {
+        try {
+            File f = new File(fileName);
+            Tika tika = new Tika();     
+            String mimeType = tika.detect(f);
+            LOG.info("Detected MIME type: "+ mimeType);
+            
+            // extract metadata: first get a parser
+            MetadataParser parser = CFG.getParser(mimeType);
+            if (null == parser) {
+                LOG.warn("Unknown content type " + mimeType + " no metadata found, listing all tags found in file.");
+                MetadataParserTika mpt = new MetadataParserTika();
+                mpt.listMetadata(f);
+            } else {
+                PropertyMapper mapper = CFG.getPropertyMapper(mimeType);
+                if (null == mapper)
+                    throw new MapperException("Unknown mime type (no configuration): " + mimeType);
+                String typeId = mapper.getMappedTypeId();
+                if (null == typeId)
+                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
+                
+                // Session available? if yes do conversion
+                TypeDefinition td = null;
+                if (null!= session) {
+                    td = session.getTypeDefinition(typeId);
+                    if (null == td)
+                        throw new MapperException("CMIS type " + typeId + " does not exist on server.");
+                    else
+                    	LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
+                }
+                
+                parser.extractMetadata(f, td);
+                Map<String, Object> properties = parser.getCmisProperties();
+                for (String key : properties.keySet()) {
+                    LOG.info("Found metadata tag " + key + "mapped to " + properties.get(key));
+                }
+            }                        
+        } catch (Exception e) {
+            LOG.error("Failed to list metadata", e);
+        } finally {
+        }
+        LOG.debug("Conversion and transfer done.");            
+    }
+    
+    static public void main(String[] args) {
+        String fileName = args[0];
+        LOG.debug("extracting CMIS properties for file " + fileName);
+        try {
+            new FileCopier().listMetadata(fileName);            
+        } catch (Exception e) {
+            LOG.error(e.toString(), e);
+        } finally {
+        }
+        LOG.debug("Extraction done.");    
+    }
+}

Added: 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=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/main/ObjGenApp.java Wed Aug 15 14:07:56 2012
@@ -0,0 +1,801 @@
+/*
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.tools.main;
+
+import java.io.BufferedReader;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
+
+import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
+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;
+import org.apache.chemistry.opencmis.util.repository.TimeLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ObjGenApp {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ObjGenApp.class.getName());
+    private static final String PROP_USER = SessionParameter.USER;
+    private static final String PROP_PASSWORD = SessionParameter.PASSWORD;
+    private static final String DEFAULT_USER = "user";
+    private static final String DEFAULT_PASSWORD = "dummy";
+    private static final String PROP_ATOMPUB_URL = SessionParameter.ATOMPUB_URL;
+    private static final String PROP_WS_URL = "org.apache.chemistry.opencmis.binding.webservices.url";
+    private static final String PROP_BROWSER_URL = SessionParameter.BROWSER_URL;
+    private static final String PROP_BINDING = SessionParameter.BINDING_TYPE;
+    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_BINDING = "atompub";
+    private static final String CMD = "Command";
+    private static final String REPOSITORY_ID = "RepositoryId";
+    private static final String FILLER_DOCUMENT_TYPE_ID = "DocumentTypeId";
+    private static final String FILLER_FOLDER_TYPE_ID = "FolderTypeId";
+    private static final String FILLER_DOCS_PER_FOLDER = "DocsPerFolder";
+    private static final String FILLER_FOLDERS_PER_FOLDER = "FoldersPerFolder";
+    private static final String FILLER_DEPTH = "Depth";
+    private static final String FILLER_CONTENT_SIZE = "ContentSizeInKB";
+    private static final String COUNT = "Count";
+    private static final String CLEANUP = "Cleanup";
+    private static final String ROOTFOLDER = "RootFolder";
+    private static final String THREADS = "Threads";
+    private static final String CONTENT_KIND = "ContentKind";
+    private static final String FILE_NAME_PATTERN = "FileName";
+    private static final String LOCAL_FILE = "File";
+    private static final String LOCAL_DIR = "Dir";
+
+    private static final String BINDING_ATOM = "atompub";
+    private static final String BINDING_WS = "webservices";
+    private static final String BINDING_BROWSER = "browser";
+
+    BindingType fBindingType;
+    private CONTENT_KIND fContentKind;
+    CmisBinding binding;
+    
+    OptionSpec<String> fCmd;
+    OptionSpec<Integer> fDepth;
+    OptionSpec<Integer> fContentSize;
+    OptionSpec<Integer> fFolderPerFolder;
+    OptionSpec<Integer> fDocsPerFolder;
+    OptionSpec<String> fFolderType;
+    OptionSpec<String> fDocType;
+    OptionSpec<String> fRepoId;
+    OptionSpec<Integer> fCount;
+    OptionSpec<Boolean> fCleanup;
+    OptionSpec<String> fRootFolder;
+    OptionSpec<Integer> fThreads;
+    OptionSpec<String> fFileName;
+    OptionSpec<String> fContentKindStr;
+    OptionSpec<String> fFileNamePattern;
+    OptionSpec<String> fLocalDir;
+    OptionSpec<String> fLocalFile;
+    
+    public static void main(String[] args) {
+
+        ObjGenApp app = new ObjGenApp();
+        try {
+            app.processCmdLine(args);
+        } catch (CmisBaseException ce) {
+            System.out.println("Error: Could not process command. " + ce);
+            System.out.println("Extended error: " + ce.getErrorContent());
+            ce.printStackTrace();
+        } catch (Exception e) {
+            System.out.println("Could not fill repository " + e);
+            e.printStackTrace();
+        }
+    }
+
+    private void processCmdLine(String[] args) {
+
+        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");
+        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);
+        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");
+        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");
+        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)
+                .describedAs("file name of a file to be copied to the repository");
+        OptionSet options = parser.parse(args);
+
+        if (options.valueOf(fCmd) == null || options.has("?")) {
+            usage(parser);
+        }
+
+        String binding = getBinding();
+        
+        if (binding.equals(BINDING_WS)) {
+            fBindingType = BindingType.WEBSERVICES;
+        } else if (binding.equals(BINDING_ATOM)) {
+            fBindingType = BindingType.ATOMPUB;
+        } 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);
+            return;
+        }
+
+        String kind = options.valueOf(fContentKindStr);
+        if (null == kind) {
+            if (options.valueOf(fContentSize) > 0)
+                fContentKind = ObjectGenerator.CONTENT_KIND.StaticText;
+            else
+                fContentKind = null;
+        } else if (kind.equals("static/text"))
+            fContentKind = ObjectGenerator.CONTENT_KIND.StaticText;
+        else if (kind.equals("lorem/text"))
+            fContentKind = ObjectGenerator.CONTENT_KIND.LoremIpsumText;
+        else if (kind.equals("lorem/html"))
+            fContentKind = ObjectGenerator.CONTENT_KIND.LoremIpsumHtml;
+        else if (kind.equals("fractal/jpeg"))
+            fContentKind = ObjectGenerator.CONTENT_KIND.ImageFractalJpeg;
+        else {
+            System.out.println("Unknown content kind: " + options.valueOf(fContentKindStr));
+            System.out.println("  must be one of static/text, lorem/text, lorem/html, fractal/jpeg");
+            usage(parser);
+        }
+
+        if (null == options.valueOf(fCmd)) {
+            System.out.println("No command given.");
+            usage(parser);
+        } else if (options.valueOf(fCmd).equals("FillRepository")) {
+            fillRepository(options);
+        } else if (options.valueOf(fCmd).equals("CreateDocument")) {
+            createSingleDocument(options);
+        } else if (options.valueOf(fCmd).equals("CreateFolder")) {
+            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("CreateFiles")) {
+            createFiles(options);
+        } else if (options.valueOf(fCmd).equals("CopyFiles")) {
+            transferFiles(options);
+        } else if (options.valueOf(fCmd).equals("CopyFilesTest")) { // undocumented
+            transferFilesTest(options);
+        } else {
+            System.out.println("Unknown cmd: " + options.valueOf(fCmd));
+            usage(parser);
+        }
+    }
+
+    // private void preInitExpensiveTasks() {
+    // // JAXB initialization is very expensive, count this separate:
+    // TimeLogger logger = new TimeLogger("Initialization");
+    // logger.start();
+    // try {
+    // JaxBHelper.createMarshaller();
+    // }
+    // catch (JAXBException e) {
+    // System.out.print("Failuer in JAXB init: " + e);
+    // e.printStackTrace();
+    // } // dummy call just to get initialized
+    // logger.stop();
+    // logger.printTimes();
+    // }
+
+    private static void usage(OptionParser parser) {
+        try {
+            System.out.println();
+            System.out.println("ObjGenApp is a command line tool for testing a CMIS repository.");
+            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("                       " + 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");
+            return;
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void fillRepository(String repoId, int docsPerFolder, int foldersPerFolders, int depth,
+            String documentType, String folderType, int contentSizeInKB, String rootFolderId, boolean doCleanup) {
+
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator.prepareForCreateTree(
+                getClientBindings(), repoId, docsPerFolder, foldersPerFolders, depth, documentType, folderType,
+                contentSizeInKB, rootFolderId, fContentKind, doCleanup);
+        ObjectGenerator gen = runner.getObjectGenerator();
+        runner.doCreateTree();
+
+        System.out.println();
+        System.out.println("Result:");
+        System.out.println("Filling repository succeeded.");
+        System.out.println("Folder used as root for creation (null=rootFolderId): " + rootFolderId);
+        System.out.println("Number of documents created: " + gen.getDocumentsInTotal());
+        System.out.println("Number of folders created: " + gen.getFoldersInTotal());
+        gen.printTimings();
+    }
+
+    private void fillRepositoryMT(int noThreads, String repoId, int docsPerFolder, int foldersPerFolders, int depth,
+            String documentType, String folderType, int contentSizeInKB, String rootFolderId, boolean doCleanup) {
+
+        // Step 1: create a root folder for each thread
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator
+                .prepareForCreateFolder(getClientBindings(), repoId, folderType, rootFolderId, noThreads, doCleanup);
+        String[] folderIds = runner.doCreateFolder();
+
+        // 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);
+
+        MultiThreadedObjectGenerator.runMultiThreaded(runners);
+        System.out.println("Filling repository succeeded.");
+    }
+
+    private void printParameters(OptionSet options) {
+        if (fBindingType == BindingType.ATOMPUB) {
+            System.out.println("Using AtomPub, connecting to  " + getAtomPubUrl());
+        } else if (fBindingType == BindingType.WEBSERVICES) {
+            System.out.println("Using WebService, connecting to  " + getWsUrl());
+        } else if (fBindingType == BindingType.BROWSER) {
+            System.out.println("Using Browser binding, connecting to  " + getBrowserUrl());
+        } else
+            System.out.println("Unknown binding type.");
+
+        System.out.println("Repository id is: " + options.valueOf(fRepoId));
+        System.out.println("Content size: " + options.valueOf(fContentSize));
+        System.out.println("Document Type: " + options.valueOf(fDocType));
+        System.out.println("Folder id used as root: " + options.valueOf(fRootFolder));
+        System.out.println("Delete all objects after creation: " + options.valueOf(fCleanup));
+        System.out.println("Number of actions to perform: " + options.valueOf(fCount));
+        System.out.println("Number of threads to start: " + options.valueOf(fThreads));
+        System.out.println("Kind of created content: " + options.valueOf(fContentKindStr));
+    }
+
+    private void createSingleDocument(OptionSet options) {
+        System.out.println();
+        System.out.println("Creating document with parameters:");
+        printParameters(options);
+        int noThreads = options.valueOf(fThreads);
+        if (noThreads <= 1) {
+            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));
+        }
+    }
+
+    private void fillRepository(OptionSet options) {
+        System.out.println();
+        printParameters(options);
+        System.out.println("Creating object tree with folowing parameters: ");
+        System.out.println("Documents per folder: " + options.valueOf(fDocsPerFolder));
+        System.out.println("Folder per folder: " + options.valueOf(fFolderPerFolder));
+        System.out.println("Depth: " + options.valueOf(fDepth));
+        System.out.println("Folder Type: " + options.valueOf(fFolderType));
+
+        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));
+        } 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));
+        }
+
+    }
+
+    private void createFolders(OptionSet options) {
+        System.out.println();
+        System.out.println("Creating folder with parameters:");
+        printParameters(options);
+        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));
+        } else {
+            createFoldersMT(noThreads, options.valueOf(fRepoId), options.valueOf(fFolderType), options
+                    .valueOf(fRootFolder), options.valueOf(fCount), options.valueOf(fCleanup));
+        }
+    }
+
+    private void createSingleDocument(String repoId, String documentType, int contentSizeInKB, String rootFolderId,
+            int docCount, boolean doCleanup) {
+
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator
+                .prepareForCreateDocument(getClientBindings(), repoId, documentType, contentSizeInKB, rootFolderId, docCount,
+                        fContentKind, doCleanup);
+        ObjectGenerator gen = runner.getObjectGenerator();
+        String[] ids = runner.doCreateDocument();
+        System.out.println();
+        System.out.println("Result:");
+        System.out.println("Document creation succeeded.");
+        System.out.println("Folder used as root for creation: " + rootFolderId);
+        System.out.println("Ids of created documents: ");
+        if (null == ids) {
+            System.out.println("<none>");
+        } else {
+            for (int i = 0; i < ids.length; i++) {
+                System.out.println(ids[i]);
+            }
+        }
+        gen.printTimings();
+        gen.resetCounters();
+    }
+
+    private void createSingleDocumentMT(int noThreads, String repoId, String documentType, int contentSizeInKB,
+            String rootFolderId, int docCount, boolean doCleanup) {
+
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner[] runners = MultiThreadedObjectGenerator
+                .prepareForCreateDocumentMT(noThreads, getClientBindings(), repoId, documentType, contentSizeInKB,
+                        rootFolderId, docCount, fContentKind, doCleanup);
+
+        MultiThreadedObjectGenerator.runMultiThreaded(runners);
+        System.out.println("Document creation succeeded. All threads terminated.");
+    }
+
+    private void createFolders(String repoId, String folderType, String rootFolderId, int noFolders, boolean doCleanup) {
+
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner runner = MultiThreadedObjectGenerator
+                .prepareForCreateFolder(getClientBindings(), repoId, folderType, rootFolderId, noFolders, doCleanup);
+        ObjectGenerator gen = runner.getObjectGenerator();
+        String[] ids = runner.doCreateFolder();
+        System.out.println();
+        System.out.println("Result:");
+        System.out.println("Folder creation succeeded.");
+        System.out.println("Ids of created folders: ");
+        if (null == ids) {
+            System.out.println("<none>");
+        } else {
+            for (int i = 0; i < ids.length; i++) {
+                System.out.println(ids[i]);
+            }
+        }
+        gen.printTimings();
+        gen.resetCounters();
+    }
+
+    private void createFoldersMT(int noThreads, String repoId, String folderType, String rootFolderId, int noFolders,
+            boolean doCleanup) {
+
+        MultiThreadedObjectGenerator.ObjectGeneratorRunner[] runners = MultiThreadedObjectGenerator
+                .prepareForCreateFolderMT(noThreads, getClientBindings(), repoId, folderType, rootFolderId, noFolders,
+                        doCleanup);
+        MultiThreadedObjectGenerator.runMultiThreaded(runners);
+        System.out.println("Folder creation succeeded.");
+    }
+
+    private void callRepoInfo(String repositoryId, int count) {
+        RepositoryService repSvc = getClientBindings().getRepositoryService();
+        TimeLogger timeLogger = new TimeLogger("RepoInfoTest");
+        RepositoryInfo repoInfo = null;
+        for (int i = 0; i < count; i++) {
+            binding.clearRepositoryCache(repositoryId);
+            timeLogger.start();
+            repoInfo = repSvc.getRepositoryInfo(repositoryId, null);
+            timeLogger.stop();
+        }
+        System.out.println("Root Folder id is: " + (repoInfo == null ? "<unknown>" : repoInfo.getRootFolderId()));
+        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));
+    }
+
+    private void createFiles(OptionSet options) {
+        ContentStream contentStream = null;
+        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++) {
+                String fileName = String.format(fileNamePattern, i);
+                System.out.println("Generating file: " + fileName);
+                if (contentSize > 0) {
+                    switch (fContentKind) {
+                    case StaticText:
+                        contentStream = objGen.createContentStaticText();
+                        break;
+                    case LoremIpsumText:
+                        contentStream =  objGen.createContentLoremIpsumText();
+                        break;
+                    case LoremIpsumHtml:
+                        contentStream =  objGen.createContentLoremIpsumHtml();
+                        break;
+                    case ImageFractalJpeg:
+                        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);  
+                is.close();
+                is = null;
+                os.close();
+                os = null;
+            }
+        } catch (Exception e) {
+            System.err.println("Error generating file: " + e);
+            e.printStackTrace();
+        } finally {
+            try {
+                if (null != is)
+                        is.close();
+                if (null != os)
+                    os.close();
+            } catch (IOException e) {
+            }            
+        }
+    }
+
+    private void transferFiles(OptionSet options) {
+        String fileName = options.valueOf(fLocalFile);
+        String dirName = options.valueOf(fLocalDir);
+        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)
+            name = dirName;
+        
+        if (null == repoId || repoId.length() == 0) {
+            System.out.println("Error: You have to provide a repository id");
+            return;
+        }
+        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);
+    }
+
+    private Map<String, String> getConnectionParameters(String binding, String repoId) {
+        Map<String, String> parameters = new HashMap<String, String>();
+        parameters.put(SessionParameter.REPOSITORY_ID, repoId);
+        parameters.put(SessionParameter.BINDING_TYPE, binding);
+
+        if (binding.equals(BindingType.ATOMPUB.value())) {
+            parameters.put(SessionParameter.ATOMPUB_URL, getAtomPubUrl());
+            filLoginParams(parameters, getUser(), getPassword());
+        } else if (binding.equals(BindingType.WEBSERVICES.value())) {
+            fillWSParameters(parameters, getWsUrl(), isPrefix(getWsUrl()), getUser(), getPassword());
+        } else if (binding.equals(BindingType.BROWSER.value())) {
+            parameters.put(SessionParameter.BROWSER_URL, getBrowserUrl());
+            filLoginParams(parameters, getUser(), getPassword());
+        } else {
+            System.out.println("Error unknown binding: " + binding);
+        }
+        fillCustomHeaders(parameters);
+
+        return parameters;
+    }
+
+    private CmisBinding getClientBindings() {
+        if (binding == null) {
+            if (fBindingType == BindingType.ATOMPUB) {
+                binding = createAtomBinding(getAtomPubUrl(), getUser(), getPassword());
+            } if (fBindingType == BindingType.WEBSERVICES) {
+                String url = getWsUrl();
+                binding = createWSBinding(url, isPrefix(url), getUser(), getPassword()); 
+            } else if (fBindingType == BindingType.BROWSER) {
+                binding = createBrowserBinding(getBrowserUrl(), getUser(), getPassword()); 
+            }
+        }
+        return binding;
+    }
+
+    private static void filLoginParams(Map<String, String> parameters, String user, String password) {
+        if (user != null && user.length() > 0) {
+            parameters.put(SessionParameter.USER, user);
+        }
+        if (user != null && user.length() > 0) {
+            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());    		
+    	}    		
+    }
+
+    private static CmisBinding createAtomBinding(String url, String user, String password) {
+
+        // gather parameters
+        Map<String, String> parameters = new HashMap<String, String>();
+        filLoginParams(parameters, user, password);
+        fillCustomHeaders(parameters);
+
+        // get factory and create binding
+        CmisBindingFactory factory = CmisBindingFactory.newInstance();
+        parameters.put(SessionParameter.ATOMPUB_URL, url);
+        CmisBinding binding = factory.createCmisAtomPubBinding(parameters);
+        return binding;
+    }
+
+    private static CmisBinding createBrowserBinding(String url, String user, String password) {
+
+        // gather parameters
+        Map<String, String> parameters = new HashMap<String, String>();
+        filLoginParams(parameters, user, password);
+        fillCustomHeaders(parameters);
+
+        // get factory and create binding
+        CmisBindingFactory factory = CmisBindingFactory.newInstance();
+        parameters.put(SessionParameter.BROWSER_URL, url);
+        CmisBinding binding = factory.createCmisBrowserBinding(parameters);
+        return binding;
+    }
+
+    private static boolean isPrefix(String url) {
+        boolean isPrefix = true;
+        String urlLower = url.toLowerCase();
+
+        if (urlLower.endsWith("?wsdl")) {
+            isPrefix = false;
+        } else if (urlLower.endsWith(".wsdl")) {
+            isPrefix = false;
+        } else if (urlLower.endsWith(".xml")) {
+            isPrefix = false;
+        }
+        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) {
+        // gather parameters
+        parameters.put(SessionParameter.USER, username);
+        parameters.put(SessionParameter.PASSWORD, password);
+
+        if (!isPrefix) {
+            parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url);
+            parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url);
+        } else {
+            parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+            parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+        }
+    }
+
+    private static String getBinding() {
+        return System.getProperty(PROP_BINDING, DEFAULT_BINDING);
+    }
+    
+    private static String getAtomPubUrl() {
+        return System.getProperty(PROP_ATOMPUB_URL, DEFAULT_ATOMPUB_URL);
+    }
+
+    private static String getWsUrl() {
+        return System.getProperty(PROP_WS_URL, DEFAULT_WS_URL);
+    }
+
+    private static String getBrowserUrl() {
+        return System.getProperty(PROP_BROWSER_URL, DEFAULT_BROWSER_BINDING_URL);
+    }
+
+    private static String getUser() {
+        return System.getProperty(PROP_USER, DEFAULT_USER);
+    }
+
+    private static String getPassword() {
+        return System.getProperty(PROP_PASSWORD, DEFAULT_PASSWORD);
+    }
+
+    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);
+//    			}
+    		}
+    	}
+        return customHeaders;
+    }
+
+    private static void getUrl(String urlStr) {
+        URL url;
+        InputStream is;
+        InputStreamReader isr;
+        BufferedReader r;
+        String str;
+
+        try {
+            System.out.println("Reading URL: " + urlStr);
+            url = new URL(urlStr);
+            is = url.openStream();
+            isr = new InputStreamReader(is);
+            r = new BufferedReader(isr);
+            do {
+                str = r.readLine();
+                if (str != null) {
+                    System.out.println(str);
+                }
+            } while (str != null);
+        } catch (MalformedURLException e) {
+            System.out.println("Must enter a valid URL" + e);
+        } catch (IOException e) {
+            System.out.println("Can not connect" + e);
+        }
+    }
+
+}

Added: 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=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/AbstractPropertyMapper.java Wed Aug 15 14:07:56 2012
@@ -0,0 +1,61 @@
+/*
+ * Li
+censed 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.tools.mapper;
+
+import java.util.Properties;
+
+public abstract class AbstractPropertyMapper implements PropertyMapper {
+    
+    private static 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;    
+
+    public boolean initialize(String cfgPrefix, String typeKey, Properties properties) {
+        propPrefix = cfgPrefix + "." + typeKey;
+        cmisTypeId =   properties.getProperty(propPrefix + ".typeId");
+        String contentTypeEntry = properties.getProperty(propPrefix);
+         
+        contentTypes = contentTypeEntry.split("\\:");
+        for (int i=0; i<contentTypes.length; i++) {
+            contentTypes[i] = contentTypes[i].trim();
+        }
+
+        String df = properties.getProperty(propPrefix + ".dateFormat");
+        if (null!=df)
+            dateFormat = df;
+                
+        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;
+    }
+
+}

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/Configurator.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/Configurator.java?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/Configurator.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/Configurator.java Wed Aug 15 14:07:56 2012
@@ -0,0 +1,251 @@
+/*
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.tools.mapper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.chemistry.opencmis.tools.parser.MetadataParser;
+import org.apache.chemistry.opencmis.tools.parser.MetadataParserTika;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Configurator {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Configurator.class.getName());
+    
+    private static Configurator INSTANCE;
+    static final String PREFIX = "mapping.contentType";
+    
+    public static Configurator getInstance() {
+        if (null == INSTANCE)
+            INSTANCE = new Configurator();
+        return INSTANCE;
+    }
+    
+    private Properties properties;
+    private Map<String, PropertyMapper> contentTypeMapperMap  = new HashMap<String, PropertyMapper>();
+    private Map<String, MetadataParser> parserMap = new HashMap<String, MetadataParser>();
+    private String defaultDocumentType;
+    private String defaultFolderType;
+    
+    private Configurator() {     
+        loadProperties();
+        loadDefaults();
+        buildMapperMap();
+        createParsers();
+    }
+    
+    // just for unit tests
+    Configurator(Properties props) {
+//        contentTypeMapperMap = new HashMap<String, PropertyMapper>();
+        this.properties = props;
+    }
+    
+    
+    public PropertyMapper getPropertyMapper(String contentType) {
+        MetadataParser parser = getParser(contentType);
+        return parser.getMapper();
+    }
+    
+    public MetadataParser getParser(String contentType) {
+        MetadataParser parser = parserMap.get(contentType);
+        if (null == parser) {
+            // if not found try a more generic one
+            String genericContentType = contentType.substring(0, contentType.indexOf('/')) + "/*";
+            for (String key: parserMap.keySet()) {
+                if (key.equals(genericContentType))
+                    return parserMap.get(key);
+            }
+        }
+        return parser;
+        
+//        for (String contentType : contentTypes) {
+//            if (contentType.equals(mimeType))
+//                return cmisTypeId;
+//            boolean isStar = contentType.endsWith("/*");
+//            if (isStar) {
+//                String generalPartParam = mimeType.substring(0, mimeType.indexOf('/'));
+//                String generalPartCfg = contentType.substring(0, mimeType.indexOf('/'));
+//                if (generalPartParam.equals(generalPartCfg))
+//                    return cmisTypeId;
+//            }
+//        }
+//        return null;        
+    }
+
+    private void loadProperties() {
+        // Returns null on lookup failures:
+        InputStream in = Configurator.class.getResourceAsStream ("/mapping.properties");
+        if (in != null)
+        {
+            properties = new Properties();
+            try {
+                properties.load (in);
+            } catch (IOException e) {
+                LOG.error(e.toString(), e);
+                e.printStackTrace();
+                throw new MapperException("Could not load file mapping.properties as resource", e);
+            } 
+        }
+    }
+    
+    private void loadDefaults() {
+        defaultDocumentType = properties.getProperty(PREFIX + ".default.document");
+        if (null == defaultDocumentType)
+            defaultDocumentType = "cmis:document";
+        
+        defaultFolderType = properties.getProperty(PREFIX + ".default.folder");
+        if (null == defaultFolderType)
+            defaultFolderType = "cmis:folder";                
+    }
+    
+    public String getDefaultDocumentType() {
+        return defaultDocumentType;
+    }
+    
+    public String getDefaultFolderType() {
+        return defaultFolderType;
+    }
+
+    public final Properties getProperties() {
+        return properties;
+    }
+    
+    /**
+     * return an overridden MIME type from a file extension
+     * 
+     * @param fileExtension
+     *      enforced or content-type or null if none is set
+     */
+    public String getContentType(String fileExtension) {
+        return properties.getProperty(PREFIX+ ".forceContentType." + fileExtension, null);
+    }
+    
+    String[] getTypeKeys() {
+        String s = properties.getProperty(PREFIX + "s");
+        
+        if (null == s)
+            return null;
+        
+        String[] keys = s.split(",");
+        
+        for (int i=0; i<keys.length; i++)
+            keys[i] = keys[i].trim();
+        
+        return keys;
+    }
+    
+    void  buildMapperMap() {
+        
+        String[] typeKeys = getTypeKeys();
+        for (String typeKey : typeKeys) {
+            PropertyMapper mapper = loadMapperClass(typeKey);
+            String contentType = properties.getProperty(PREFIX + "." + typeKey);
+            if (null == contentType) 
+                throw new MapperException("Missingt content type in properties: " + PREFIX + "." + contentType);
+            boolean ok = mapper.initialize(PREFIX, typeKey, properties);
+
+            if (ok)
+                contentTypeMapperMap.put(typeKey, mapper);
+        }        
+    }
+    
+    void createParsers() {
+        String[] typeKeys = getTypeKeys();
+        for (String typeKey : typeKeys) {
+            MetadataParser parser = loadParserClass(typeKey);
+            String contentType = properties.getProperty(PREFIX + "." + typeKey);
+            if (null == contentType) 
+                throw new MapperException("Missing content type in properties: " + PREFIX + "." + contentType);
+            
+            PropertyMapper mapper = contentTypeMapperMap.get(typeKey);
+
+            parser.initialize(mapper, contentType);
+            String[] contentTypes = parser.getContentTypes();
+            for (String ct : contentTypes)
+                parserMap.put(ct, parser);
+        }                
+    }
+    
+    MetadataParser loadParserClass(String typeKey) {
+        String className = properties.getProperty(PREFIX + "." + typeKey + ".parserClass");
+        if (null == className) // use Tika as default parser if none is configured
+            className = MetadataParserTika.class.getName();
+//            throw new MapperException("Missing parser class in properties: " + PREFIX + "." + typeKey + ".parserClass");
+
+        Object obj = null;
+
+        try {
+            obj = Class.forName(className).newInstance();
+        } catch (InstantiationException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load metadata parser, cannot instantiate " + className, e);
+        } catch (IllegalAccessException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load metadata parser, cannot access " + className, e);
+        } catch (ClassNotFoundException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load metadata parser, class not found: " + className, e);
+        }
+
+        if (obj instanceof MetadataParser) {
+            return (MetadataParser) obj;
+        } else {
+            throw new MapperException("Illegal class to create metadata parser: " + className + ", must implement MetadataParser interface.");
+        }
+    }
+
+    PropertyMapper loadMapperClass(String typeKey) {
+        String className = properties.getProperty(PREFIX + "." + typeKey + ".mapperClass");
+        if (null == className) 
+            className = PropertyMapperTika.class.getName();
+//            throw new MapperException("Missing property mapper in properties: " + PREFIX + "." + typeKey + ".mapperClass");
+
+        Object obj = null;
+
+        try {
+            obj = Class.forName(className).newInstance();
+        } catch (InstantiationException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load mapping configuration, cannot instantiate " + className, e);
+        } catch (IllegalAccessException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load mapping configuration, cannot access " + className, e);
+        } catch (ClassNotFoundException e) {
+            LOG.error(e.toString(), e);
+            throw new MapperException(
+                    "Illegal class to load mapping configuration, class not found: " + className, e);
+        }
+
+        if (obj instanceof PropertyMapper) {
+            return (PropertyMapper) obj;
+        } else {
+            throw new MapperException("Illegal class to create property mapper: " + className + ", must implement PropertyMapper interface.");
+        }
+    }
+}

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/MapperException.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/MapperException.java?rev=1373426&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/MapperException.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/mapper/MapperException.java Wed Aug 15 14:07:56 2012
@@ -0,0 +1,36 @@
+/*
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.tools.mapper;
+
+
+
+public class MapperException extends RuntimeException {
+    
+    private static final long serialVersionUID = 1L;
+
+    public MapperException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public MapperException(String message) {
+        super(message);
+    }
+
+
+}