diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9304518..0000000 --- a/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -.gradle -build/ -out/ -src/test/resources/rc_credentials.json - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -**/.idea/workspace.xml -**/.idea/tasks.xml \ No newline at end of file diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 5cdacad..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -reportingcloud \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 646008a..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index c7d1c5a..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 15a15b2..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 01c7096..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index a1d1df1..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 6933c1e..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 1c24f9a..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_google_code_gson_gson_1_7_2.xml b/.idea/libraries/Gradle__com_google_code_gson_gson_1_7_2.xml deleted file mode 100644 index 2797cf5..0000000 --- a/.idea/libraries/Gradle__com_google_code_gson_gson_1_7_2.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml deleted file mode 100644 index 5edd3eb..0000000 --- a/.idea/libraries/Gradle__junit_junit_4_11.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml deleted file mode 100644 index e29af23..0000000 --- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 9922ac7..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 4095b48..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/reportingcloud.iml b/.idea/modules/reportingcloud.iml deleted file mode 100644 index 9b27e72..0000000 --- a/.idea/modules/reportingcloud.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/reportingcloud_main.iml b/.idea/modules/reportingcloud_main.iml deleted file mode 100644 index 399e4aa..0000000 --- a/.idea/modules/reportingcloud_main.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/reportingcloud_test.iml b/.idea/modules/reportingcloud_test.iml deleted file mode 100644 index 450eabb..0000000 --- a/.idea/modules/reportingcloud_test.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 2f7cebe..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,18 +0,0 @@ -## Copyright © 2017, Text Control GmbH. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this list of conditions and the following - disclaimer. - -- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 744f57e..0000000 --- a/README.md +++ /dev/null @@ -1,29 +0,0 @@ -![Logo](https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/resource/rc_logo_512.png) - -# ReportingCloud Java SDK - -This is the official Java SDK for the ReportingCloud Web API. It is authored, maintained and fully supported by [Text Control GmbH](http://www.textcontrol.com). - -[http://www.reporting.cloud](http://www.reporting.cloud) - -Before using ReportingCloud, please sign up to the service: - -[https://portal.reporting.cloud](https://portal.reporting.cloud) - -## API Documentation - -The API documentation for the ReportingCloud Java SDK can be found [here](https://textcontrol.github.io/txtextcontrol-reportingcloud-java/). - -## Build - -Building from source requires the Java JDK 8. To build, change to the project's root directory (the location of `build.gradle`) and run - - $ gradlew build - -To build the API documentation, run - - $ gradlew javadoc - -## Contributing - -Bug reports and pull requests are welcome on GitHub at https://github.com/TextControl/txtextcontrol-reportingcloud-java. \ No newline at end of file diff --git a/docs/javadoc/allclasses-frame.html b/allclasses-frame.html similarity index 100% rename from docs/javadoc/allclasses-frame.html rename to allclasses-frame.html diff --git a/docs/javadoc/allclasses-noframe.html b/allclasses-noframe.html similarity index 100% rename from docs/javadoc/allclasses-noframe.html rename to allclasses-noframe.html diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 9fc18b2..0000000 --- a/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -group 'com.textcontrol.reportingcloud' -version '1.3' - -apply plugin: 'java' -apply plugin: 'maven-publish' - -sourceCompatibility = 1.8 - -repositories { - mavenCentral() -} - -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.11' - - // http://mvnrepository.com/artifact/com.google.code.gson/gson - compile group: 'com.google.code.gson', name: 'gson', version: '1.7.2' -} - -task sourceJar(type: Jar) { - from sourceSets.main.allJava - classifier "sources" -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - artifact sourceJar - } - } - repositories { - maven { - // change to point to your repo, e.g. http://my.org/repo - url "$buildDir/repo" - } - } -} diff --git a/docs/javadoc/com/textcontrol/reportingcloud/APIKey.html b/com/textcontrol/reportingcloud/APIKey.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/APIKey.html rename to com/textcontrol/reportingcloud/APIKey.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/AccountSettings.html b/com/textcontrol/reportingcloud/AccountSettings.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/AccountSettings.html rename to com/textcontrol/reportingcloud/AccountSettings.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/AppendBody.html b/com/textcontrol/reportingcloud/AppendBody.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/AppendBody.html rename to com/textcontrol/reportingcloud/AppendBody.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/AppendDocument.html b/com/textcontrol/reportingcloud/AppendDocument.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/AppendDocument.html rename to com/textcontrol/reportingcloud/AppendDocument.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/Credentials.html b/com/textcontrol/reportingcloud/Credentials.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/Credentials.html rename to com/textcontrol/reportingcloud/Credentials.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/DocumentDivider.html b/com/textcontrol/reportingcloud/DocumentDivider.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/DocumentDivider.html rename to com/textcontrol/reportingcloud/DocumentDivider.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/DocumentSettings.html b/com/textcontrol/reportingcloud/DocumentSettings.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/DocumentSettings.html rename to com/textcontrol/reportingcloud/DocumentSettings.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/FindAndReplaceBody.html b/com/textcontrol/reportingcloud/FindAndReplaceBody.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/FindAndReplaceBody.html rename to com/textcontrol/reportingcloud/FindAndReplaceBody.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/ImageFormat.html b/com/textcontrol/reportingcloud/ImageFormat.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/ImageFormat.html rename to com/textcontrol/reportingcloud/ImageFormat.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/IncorrectWord.html b/com/textcontrol/reportingcloud/IncorrectWord.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/IncorrectWord.html rename to com/textcontrol/reportingcloud/IncorrectWord.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/MergeBlock.html b/com/textcontrol/reportingcloud/MergeBlock.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/MergeBlock.html rename to com/textcontrol/reportingcloud/MergeBlock.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/MergeBody.html b/com/textcontrol/reportingcloud/MergeBody.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/MergeBody.html rename to com/textcontrol/reportingcloud/MergeBody.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/MergeField.html b/com/textcontrol/reportingcloud/MergeField.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/MergeField.html rename to com/textcontrol/reportingcloud/MergeField.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/MergeSettings.html b/com/textcontrol/reportingcloud/MergeSettings.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/MergeSettings.html rename to com/textcontrol/reportingcloud/MergeSettings.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/ReportingCloud.html b/com/textcontrol/reportingcloud/ReportingCloud.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/ReportingCloud.html rename to com/textcontrol/reportingcloud/ReportingCloud.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/ReturnFormat.html b/com/textcontrol/reportingcloud/ReturnFormat.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/ReturnFormat.html rename to com/textcontrol/reportingcloud/ReturnFormat.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/Template.html b/com/textcontrol/reportingcloud/Template.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/Template.html rename to com/textcontrol/reportingcloud/Template.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/TemplateInfo.html b/com/textcontrol/reportingcloud/TemplateInfo.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/TemplateInfo.html rename to com/textcontrol/reportingcloud/TemplateInfo.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/APIKeyDeserializer.html b/com/textcontrol/reportingcloud/gson/APIKeyDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/APIKeyDeserializer.html rename to com/textcontrol/reportingcloud/gson/APIKeyDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/AccountSettingsDeserializer.html b/com/textcontrol/reportingcloud/gson/AccountSettingsDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/AccountSettingsDeserializer.html rename to com/textcontrol/reportingcloud/gson/AccountSettingsDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/AppendBodySerializer.html b/com/textcontrol/reportingcloud/gson/AppendBodySerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/AppendBodySerializer.html rename to com/textcontrol/reportingcloud/gson/AppendBodySerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/AppendDocumentSerializer.html b/com/textcontrol/reportingcloud/gson/AppendDocumentSerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/AppendDocumentSerializer.html rename to com/textcontrol/reportingcloud/gson/AppendDocumentSerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/DocumentSettingsSerializer.html b/com/textcontrol/reportingcloud/gson/DocumentSettingsSerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/DocumentSettingsSerializer.html rename to com/textcontrol/reportingcloud/gson/DocumentSettingsSerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/FindAndReplaceBodySerializer.html b/com/textcontrol/reportingcloud/gson/FindAndReplaceBodySerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/FindAndReplaceBodySerializer.html rename to com/textcontrol/reportingcloud/gson/FindAndReplaceBodySerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/IncorrectWordDeserializer.html b/com/textcontrol/reportingcloud/gson/IncorrectWordDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/IncorrectWordDeserializer.html rename to com/textcontrol/reportingcloud/gson/IncorrectWordDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/MergeBlockDeserializer.html b/com/textcontrol/reportingcloud/gson/MergeBlockDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/MergeBlockDeserializer.html rename to com/textcontrol/reportingcloud/gson/MergeBlockDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/MergeBodySerializer.html b/com/textcontrol/reportingcloud/gson/MergeBodySerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/MergeBodySerializer.html rename to com/textcontrol/reportingcloud/gson/MergeBodySerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/MergeFieldDeserializer.html b/com/textcontrol/reportingcloud/gson/MergeFieldDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/MergeFieldDeserializer.html rename to com/textcontrol/reportingcloud/gson/MergeFieldDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/MergeSettingsSerializer.html b/com/textcontrol/reportingcloud/gson/MergeSettingsSerializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/MergeSettingsSerializer.html rename to com/textcontrol/reportingcloud/gson/MergeSettingsSerializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/TemplateDeserializer.html b/com/textcontrol/reportingcloud/gson/TemplateDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/TemplateDeserializer.html rename to com/textcontrol/reportingcloud/gson/TemplateDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/TemplateInfoDeserializer.html b/com/textcontrol/reportingcloud/gson/TemplateInfoDeserializer.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/TemplateInfoDeserializer.html rename to com/textcontrol/reportingcloud/gson/TemplateInfoDeserializer.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/package-frame.html b/com/textcontrol/reportingcloud/gson/package-frame.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/package-frame.html rename to com/textcontrol/reportingcloud/gson/package-frame.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/package-summary.html b/com/textcontrol/reportingcloud/gson/package-summary.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/package-summary.html rename to com/textcontrol/reportingcloud/gson/package-summary.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/gson/package-tree.html b/com/textcontrol/reportingcloud/gson/package-tree.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/gson/package-tree.html rename to com/textcontrol/reportingcloud/gson/package-tree.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/package-frame.html b/com/textcontrol/reportingcloud/package-frame.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/package-frame.html rename to com/textcontrol/reportingcloud/package-frame.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/package-summary.html b/com/textcontrol/reportingcloud/package-summary.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/package-summary.html rename to com/textcontrol/reportingcloud/package-summary.html diff --git a/docs/javadoc/com/textcontrol/reportingcloud/package-tree.html b/com/textcontrol/reportingcloud/package-tree.html similarity index 100% rename from docs/javadoc/com/textcontrol/reportingcloud/package-tree.html rename to com/textcontrol/reportingcloud/package-tree.html diff --git a/docs/javadoc/constant-values.html b/constant-values.html similarity index 100% rename from docs/javadoc/constant-values.html rename to constant-values.html diff --git a/docs/javadoc/deprecated-list.html b/deprecated-list.html similarity index 100% rename from docs/javadoc/deprecated-list.html rename to deprecated-list.html diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 9411448..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 827d0a8..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 10 09:27:52 CEST 2016 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip diff --git a/gradlew b/gradlew deleted file mode 100644 index 9d82f78..0000000 --- a/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index aec9973..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/docs/javadoc/help-doc.html b/help-doc.html similarity index 100% rename from docs/javadoc/help-doc.html rename to help-doc.html diff --git a/docs/javadoc/index-all.html b/index-all.html similarity index 100% rename from docs/javadoc/index-all.html rename to index-all.html diff --git a/docs/javadoc/index.html b/index.html similarity index 100% rename from docs/javadoc/index.html rename to index.html diff --git a/docs/javadoc/overview-frame.html b/overview-frame.html similarity index 100% rename from docs/javadoc/overview-frame.html rename to overview-frame.html diff --git a/docs/javadoc/overview-summary.html b/overview-summary.html similarity index 100% rename from docs/javadoc/overview-summary.html rename to overview-summary.html diff --git a/docs/javadoc/overview-tree.html b/overview-tree.html similarity index 100% rename from docs/javadoc/overview-tree.html rename to overview-tree.html diff --git a/docs/javadoc/package-list b/package-list similarity index 100% rename from docs/javadoc/package-list rename to package-list diff --git a/resource/rc_logo_1024.png b/resource/rc_logo_1024.png deleted file mode 100644 index 92b2bae..0000000 Binary files a/resource/rc_logo_1024.png and /dev/null differ diff --git a/resource/rc_logo_256.png b/resource/rc_logo_256.png deleted file mode 100644 index c3ad0e6..0000000 Binary files a/resource/rc_logo_256.png and /dev/null differ diff --git a/resource/rc_logo_512.png b/resource/rc_logo_512.png deleted file mode 100644 index 13470dc..0000000 Binary files a/resource/rc_logo_512.png and /dev/null differ diff --git a/docs/javadoc/script.js b/script.js similarity index 100% rename from docs/javadoc/script.js rename to script.js diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 03bae38..0000000 --- a/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'reportingcloud' - diff --git a/src/main/java/com/textcontrol/reportingcloud/APIKey.java b/src/main/java/com/textcontrol/reportingcloud/APIKey.java deleted file mode 100644 index a78e97e..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/APIKey.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * Represents a ReportingCloud API key object. - * - * @author Thorsten Kummerow - */ -public class APIKey { - - private String _key; - private boolean _isActive; - - /** - * @param key The actual API Key that belongs to the account - * @param isActive Specifies whether the API Key is active or not (not used yet). - */ - public APIKey(String key, boolean isActive) { - _key = key; - _isActive = isActive; - } - - /** - * Returns the API key. - * @return The API key. - */ - public String getKey() { return _key; } - - /** - * Returns whether the API key is active or not (not used yet). - * @return The state of the API key (active or inactive). - */ - public boolean getIsActive() { return _isActive; } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/AccountSettings.java b/src/main/java/com/textcontrol/reportingcloud/AccountSettings.java deleted file mode 100644 index 8d2bc16..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/AccountSettings.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Represents ReportingCloud account settings. - * - * @author Thorsten Kummerow - */ -public class AccountSettings { - - private String _serialNumber; - private int _createdDocuments; - private int _uploadedTemplates; - private int _maxDocuments; - private int _maxTemplates; - private ZonedDateTime _validUntil; - - public AccountSettings(String serialNumber, int createdDocuments, int uploadedTemplates, int maxDocuments, int maxTemplates, String validUntil) { - this._serialNumber = serialNumber; - this._createdDocuments = createdDocuments; - this._uploadedTemplates = uploadedTemplates; - this._maxDocuments = maxDocuments; - this._maxTemplates = maxTemplates; - this._validUntil = ZonedDateTime.parse(validUntil, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - /** - * Gets the serial number that is attached to the - * account. Possible values are "FREE", "TRIAL" and a 13 character long serial number. - * - * @return The serial number. - */ - public String getSerialNumber() { - return _serialNumber; - } - - /** - * Gets the number of created documents in the current month. - * - * @return The number of created documents. - */ - public int getCreatedDocuments() { - return _createdDocuments; - } - - /** - * Gets the number of uploaded templates to the template storage. - * - * @return The number of uploaded templates. - */ - public int getUploadedTemplates() { - return _uploadedTemplates; - } - - /** - * Gets the maximum number of documents that can be created per month. - * - * @return The maximum number of documents. - */ - public int getMaxDocuments() { - return _maxDocuments; - } - - /** - * Gets the maximum number of templates that can be uploaded to the template storage. - * - * @return The maximum number of templates. - */ - public int getMaxTemplates() { - return _maxTemplates; - } - - /** - * Gets the date until the current subscription is valid. Can be nil. - * - * @return The date until the current subscription is valid. - */ - public ZonedDateTime getValidUntil() { - return _validUntil; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/AppendBody.java b/src/main/java/com/textcontrol/reportingcloud/AppendBody.java deleted file mode 100644 index b4f0402..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/AppendBody.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.security.InvalidParameterException; -import java.util.List; - -/** - * Passes data to the {@link com.textcontrol.reportingcloud.ReportingCloud#appendDocuments appendDocuments} - * method. - * - * @author Thorsten Kummerow - */ -public class AppendBody { - - private List _documents; - private DocumentSettings _documentSettings; - - /** - * Combines documents by appending them divided by a new section, paragraph or nothing. - * @param documents The documents that are appended including divider options. - */ - public AppendBody(List documents) throws InvalidParameterException { - this(documents, null); - } - - /** - * Combines documents by appending them divided by a new section, paragraph or nothing. - * @param documents The documents that are appended including divider options. - * @param documentSettings Document settings to specify document properties such as title and - * author. - */ - public AppendBody(List documents, DocumentSettings documentSettings) throws InvalidParameterException { - if (documents.size() == 0) throw new InvalidParameterException("No documents provided."); - _documents = documents; - _documentSettings = documentSettings; - } - - /** - * Returns the documents. - * @return The documents. - */ - public List getDocuments() { return _documents; } - - /** - * Sets the list of documents. - * @param documents The list of documents. - */ - public void setDocuments(List documents) { _documents = documents; } - - /** - * Returns the document settings. - * @return The document settings. - */ - public DocumentSettings getDocumentSettings() { return _documentSettings; } - - /** - * Sets the document settings. - * @param documentSettings The document settings. - */ - public void setDocumentSettings(DocumentSettings documentSettings) { _documentSettings = documentSettings; } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/AppendDocument.java b/src/main/java/com/textcontrol/reportingcloud/AppendDocument.java deleted file mode 100644 index 32877ef..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/AppendDocument.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * A document that is appended by the {@link com.textcontrol.reportingcloud.ReportingCloud#appendDocuments appendDocuments} - * method. - * - * @author Thorsten Kummerow - */ -public class AppendDocument { - - private byte[] _document; - private DocumentDivider _divider; - - /** - * @param document The document. Supported formats are .rtf, .doc, .docx and - * .tx. - */ - public AppendDocument(byte[] document) throws IllegalArgumentException { - this(document, DocumentDivider.None); - } - - /** - * @param document The document. Supported formats are .rtf, .doc, .docx and - * .tx. - * @param divider The document divider option. - */ - public AppendDocument(byte[] document, DocumentDivider divider) throws IllegalArgumentException { - if (document == null || document.length == 0) { - throw new IllegalArgumentException("Document must not be null or empty."); - } - _document = document; - _divider = divider; - } - - /** - * Returns the document. - * @return The document. - */ - public byte[] getDocument() { return _document; } - - /** - * Sets the document. - * @param document The document. Supported formats are .rtf, .doc, .docx and - * .tx. - */ - public void setDocument(byte[] document) { _document = document; } - - /** - * Returns the document divider option. - * @return The document divider option. - */ - public DocumentDivider getDivider() { return _divider; } - - /** - * Sets the document divider option. - * @param divider The document divider option. - */ - public void setDivider(DocumentDivider divider) { _divider = divider; } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/DocumentDivider.java b/src/main/java/com/textcontrol/reportingcloud/DocumentDivider.java deleted file mode 100644 index d3c5fd4..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/DocumentDivider.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * This enum lists all possible document divider options used by method - * {@link com.textcontrol.reportingcloud.ReportingCloud#appendDocuments appendDocuments}. - * - * @author Thorsten Kummerow - */ -public enum DocumentDivider { - - /** - * None. - */ - None, - - /** - * New Paragraph. - */ - NewParagraph, - - /** - * New Section. - */ - NewSection; - - /** - * Returns the value expected by the ReportingCloud API. - * @return The value expected by the ReportingCloud API. - */ - public int toInt() { - switch (this) { - case None: return 1; - case NewParagraph: return 2; - case NewSection: return 3; - } - return 0; - } -} \ No newline at end of file diff --git a/src/main/java/com/textcontrol/reportingcloud/DocumentSettings.java b/src/main/java/com/textcontrol/reportingcloud/DocumentSettings.java deleted file mode 100644 index 8305544..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/DocumentSettings.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -/** - * Holds the merge settings needed by the {@link com.textcontrol.reportingcloud.ReportingCloud#appendDocuments appendDocuments} - * method. - * - * @author Thorsten Kummerow - */ -public class DocumentSettings { - private String _author; - private String _creatorApplication; - private String _documentSubject; - private String _documentTitle; - private String _userPassword; - private ZonedDateTime _lastModificationDate; - private ZonedDateTime _creationDate; - - public DocumentSettings() { - this._author = null; - this._creatorApplication = null; - this._documentSubject = null; - this._documentTitle = null; - this._userPassword = null; - this._lastModificationDate = null; - this._creationDate = null; - } - - /** - * Gets the document's author. - * - * @return The document's author. - */ - public String getAuthor() { - return _author; - } - - /** - * Sets the document's author. - * - * @param author The document's author. - */ - public void setAuthor(String author) { - this._author = author; - } - - /** - * Gets the application which created the document. - * - * @return The application which created the document. - */ - public String getCreatorApplication() { - return _creatorApplication; - } - - /** - * Sets the application which created the document. - * - * @param creatorApplication The application which created the document. - */ - public void setCreatorApplication(String creatorApplication) { - this._creatorApplication = creatorApplication; - } - - /** - * Gets the document's subject. - * - * @return The document's subject. - */ - public String getDocumentSubject() { - return _documentSubject; - } - - /** - * Sets the document's subject. - * - * @param documentSubject The document's subject. - */ - public void setDocumentSubject(String documentSubject) { - this._documentSubject = documentSubject; - } - - /** - * Gets the document's title. - * - * @return The document's title. - */ - public String getdocumentTitle() { - return _documentTitle; - } - - /** - * Sets the document's title. - * - * @param documentTitle The document's title. - */ - public void setDocumentTitle(String documentTitle) { - this._documentTitle = documentTitle; - } - - /** - * Gets the password needed to open the document. - * - * @return The password needed to open the document. - */ - public String getUserPassword() { - return _userPassword; - } - - /** - * Sets the password needed to open the document. - * - * @param userPassword The password needed to open the document. - */ - public void setUserPassword(String userPassword) { - this._userPassword = userPassword; - } - - /** - * Gets the creation date. - * - * @return The creation date. - */ - public ZonedDateTime getCreationDate() { - return _creationDate; - } - - /** - * Sets the creation date. - * - * @param creationDate The creation date (ISO-8601 extended offset date-time format). - * Can be null. - */ - public void setCreationDate(String creationDate) throws DateTimeParseException { - if (creationDate == null) _creationDate = null; - else _creationDate = ZonedDateTime.parse(creationDate, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - /** - * Sets the creation date. - * - * @param creationDate The creation date. Can be null. - */ - public void setCreationDate(ZonedDateTime creationDate) { - _creationDate = creationDate; - } - - /** - * Gets the last modification date. - * - * @return The last modification date. - */ - public ZonedDateTime getLastModificationDate() { - return _lastModificationDate; - } - - /** - * Sets the last modification date. - * - * @param lastModificationDate The last modification date (ISO-8601 extended offset date-time format). - * Can be null. - */ - public void setLastModificationDate(String lastModificationDate) throws DateTimeParseException { - if (lastModificationDate == null) _lastModificationDate = null; - else _lastModificationDate = ZonedDateTime.parse(lastModificationDate, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - /** - * Sets the last modification date. - * - * @param lastModificationDate The last modification date. Can be null. - */ - public void setLastModificationDate(ZonedDateTime lastModificationDate) { - _lastModificationDate = lastModificationDate; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/FindAndReplaceBody.java b/src/main/java/com/textcontrol/reportingcloud/FindAndReplaceBody.java deleted file mode 100644 index a030465..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/FindAndReplaceBody.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import javafx.util.Pair; -import java.util.List; - -/** - * Passes data to the find and replace method. - * - * @author Thorsten Kummerow - */ -public class FindAndReplaceBody { - - private MergeSettings _mergeSettings; - private byte[] _templateData; - private List> _findAndReplaceData; - - /** - * @param findAndReplaceData The find and replace pair values. - * @param templateData The source document. The supported document formats - * are .rtf, .doc, .docx, and .tx. - * @param mergeSettings Merge settings to specify merge properties and document - * properties such as title and author. - */ - public FindAndReplaceBody(List> findAndReplaceData, byte[] templateData, MergeSettings mergeSettings) { - setFindAndReplaceData(findAndReplaceData); - _mergeSettings = mergeSettings; - setTemplateData(templateData); - } - - /** - * @param findAndReplaceData The find and replace pair values. - * @param templateData The source document. The supported document formats - * are .rtf, .doc, .docx, and .tx. - */ - public FindAndReplaceBody(List> findAndReplaceData, byte[] templateData) { - this(findAndReplaceData, templateData, null); - } - - /** - * @param findAndReplaceData The find and replace pair values. - */ - public FindAndReplaceBody(List> findAndReplaceData) { - this(findAndReplaceData, null); - } - - /** - * Returns the merge settings object. - * - * @return The merge settings object. - */ - public MergeSettings getMergeSettings() { - return _mergeSettings; - } - - /** - * Sets the merge settings. - * - * @param mergeSettings The merge settings. - */ - public void setMergeSettings(MergeSettings mergeSettings) { - this._mergeSettings = mergeSettings; - } - - /** - * Returns the template document data. - * - * @return The template document data. - */ - public byte[] getTemplateData() { - return _templateData; - } - - /** - * Sets the template document data. - * - * @param templateData The template document data. - */ - public void setTemplateData(byte[] templateData) { - if ((templateData != null) && (templateData.length == 0)) templateData = null; - this._templateData = templateData; - } - - /** - * Gets the find and replace data. - * - * @return The find and replace data. - */ - public List> getFindAndReplaceData() { - return _findAndReplaceData; - } - - /** - * Sets find and replace data. - * - * @param findAndReplaceData Find and replace data. - */ - public void setFindAndReplaceData(List> findAndReplaceData) { - if (findAndReplaceData == null) throw new NullPointerException("Parameter \"findAndReplaceData\" must not be null."); - if (findAndReplaceData.isEmpty()) throw new IllegalArgumentException("findAndReplaceData must not be empty."); - this._findAndReplaceData = findAndReplaceData; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/ImageFormat.java b/src/main/java/com/textcontrol/reportingcloud/ImageFormat.java deleted file mode 100644 index 4d029be..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/ImageFormat.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * This enum lists all possible image formats for the thumbnails - * - * @author Thorsten Kummerow - */ -public enum ImageFormat { - - /** - * Joint Photographic Experts Group - */ - JPG, - - /** - * Portable Network Graphics - */ - PNG, - - /** - * Windows Bitmap - */ - BMP, - - /** - * Graphics Interchange Format - */ - GIF -} \ No newline at end of file diff --git a/src/main/java/com/textcontrol/reportingcloud/IncorrectWord.java b/src/main/java/com/textcontrol/reportingcloud/IncorrectWord.java deleted file mode 100644 index d5089a3..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/IncorrectWord.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * Represents an incorrect word in a spell checked text. - * - * @author Thorsten Kummerow - */ -public class IncorrectWord { - - private int _length; - private int _start; - private String _text; - private boolean _isDuplicate; - private String _language; - - public IncorrectWord(int length, int start, String text, boolean isDuplicate, String language) { - this._length = length; - this._start = start; - this._text = text; - this._isDuplicate = isDuplicate; - this._language = language; - } - - /** - * Returns the length of the spelled word. - * - * @return The length of the spelled word. - */ - public int getLength() { - return _length; - } - - /** - * Returns the starting position of a spelled word. - * - * @return The starting position of a spelled word. - */ - public int getStart() { - return _start; - } - - /** - * Returns the text of the spelled word. - * - * @return The text of the spelled word. - */ - public String getText() { - return _text; - } - - /** - * Returns a value indicating whether the spelled word is declared as incorrect, - * because the previous word has the same text. - * - * @return a value indicating whether the spelled word is declared as incorrect - * because the previous word has the same text. - */ - public boolean isDuplicate() { - return _isDuplicate; - } - - /** - * Returns a value indicating the language the incorrect word was spelled. - * - * @return A value indicating the language the incorrect word was spelled. - */ - public String getLanguage() { - return _language; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/MergeBlock.java b/src/main/java/com/textcontrol/reportingcloud/MergeBlock.java deleted file mode 100644 index 021771a..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/MergeBlock.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.util.List; - -/** - * Represents a merge block in a document template. - * - * @author Thorsten Kummerow - */ -public class MergeBlock { - private final String _name; - private final List _mergeBlocks; - private final List _mergeFields; - - public MergeBlock(String name, List mergeBlocks, List mergeFields) { - this._name = name; - this._mergeBlocks = mergeBlocks; - this._mergeFields = mergeFields; - } - - /** - * Returns the merge block's name. - * - * @return The merge block's name. - */ - public String getName() { - return _name; - } - - /** - * Returns the merge blocks inside the merge block. - * - * @return The merge blocks inside the merge block. - */ - public List getMergeBlocks() { - return _mergeBlocks; - } - - /** - * Returns the merge fields inside the merge block. - * - * @return The merge fields inside the merge block. - */ - public List getMergeFields() { - return _mergeFields; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/MergeBody.java b/src/main/java/com/textcontrol/reportingcloud/MergeBody.java deleted file mode 100644 index d194d44..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/MergeBody.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.security.InvalidParameterException; -import java.util.Arrays; - -/** - * Passes data to the {@link com.textcontrol.reportingcloud.ReportingCloud#mergeDocument mergeDocument} - * method. - * - * @author Thorsten Kummerow - */ -public class MergeBody { - - private byte[] _template; - private MergeSettings _mergeSettings; - private Iterable _mergeData; - - /** - * @param mergeData The merge data. Can be an iterable type of {@link java.util.HashMap} objects - * or an iterable type of objects which can be serialized to JSON by GSON. - */ - public MergeBody(Iterable mergeData) throws InvalidParameterException { - this(mergeData, null); - } - - /** - * @param mergeData The merge data. Can be an array of {@link java.util.HashMap} objects - * or an array of objects which can be serialized to JSON by GSON. - */ - public MergeBody(Object[] mergeData) throws InvalidParameterException { - this(mergeData, null); - } - - /** - * @param mergeData The merge data. Can be an iterable type of {@link java.util.HashMap} objects - * or an iterable type of objects which can be serialized to JSON by GSON. - * @param mergeSettings Merge settings to specify merge properties and document properties - * such as title and author. - */ - public MergeBody(Iterable mergeData, MergeSettings mergeSettings) throws InvalidParameterException { - this(mergeData, mergeSettings, null); - } - - /** - * @param mergeData The merge data. Can be an array of {@link java.util.HashMap} objects - * or an array of objects which can be serialized to JSON by GSON. - * @param mergeSettings Merge settings to specify merge properties and document properties - * such as title and author. - */ - public MergeBody(Object[] mergeData, MergeSettings mergeSettings) throws InvalidParameterException { - this(mergeData, mergeSettings, null); - } - - /** - * @param mergeData The merge data. Can be an iterable type of {@link java.util.HashMap} objects - * or an iterable type of objects which can be serialized to JSON by GSON. - * @param mergeSettings Merge settings to specify merge properties and document properties - * such as title and author. - * @param template The binary template document data. Supported formats are .rtf, - * .doc, .docx and .tx. - */ - public MergeBody(Iterable mergeData, MergeSettings mergeSettings, byte[] template) throws InvalidParameterException { - this._template = template; - this._mergeSettings = mergeSettings; - this.setMergeData(mergeData); - } - - /** - * @param mergeData The merge data. Can be an array of {@link java.util.HashMap} objects - * or an array of objects which can be serialized to JSON by GSON. - * @param mergeSettings Merge settings to specify merge properties and document properties - * such as title and author. - * @param template The binary template document data. Supported formats are .rtf, - * .doc, .docx and .tx. - */ - public MergeBody(Object[] mergeData, MergeSettings mergeSettings, byte[] template) throws InvalidParameterException { - this(Arrays.asList(mergeData), mergeSettings, template); - } - - /** - * Gets the binary template document data. Supported formats are .rtf, .doc, - * .docx and .tx. - * - * @return The binary template document data. - */ - public byte[] getTemplate() { - return _template; - } - - /** - * Sets the binary template document data. Supported formats are .rtf, .doc, - * .docx and .tx. - * - * @param template The binary template document data - */ - public void setTemplate(byte[] template) { - this._template = template; - } - - /** - * Gets the merge settings to specify merge properties and document properties such - * as title and author. - * - * @return The merge settings. - */ - public MergeSettings getMergeSettings() { - return _mergeSettings; - } - - /** - * Sets the merge settings to specify merge properties and document properties such - * as title and author. - * - * @param mergeSettings The merge settings. - */ - public void setMergeSettings(MergeSettings mergeSettings) { - this._mergeSettings = mergeSettings; - } - - /** - * Gets the merge data. - * - * @return The merge data. - */ - public Iterable getMergeData() { - return _mergeData; - } - - /** - * Sets the merge data. Can be an iterable type of {@link java.util.HashMap} objects or an - * iterable type of objects which can be serialized to JSON by GSON. - * - * @param mergeData The merge data. - */ - public void setMergeData(Iterable mergeData) throws InvalidParameterException { - if (mergeData == null) { - throw new InvalidParameterException("mergeData must not be null."); - } - this._mergeData = mergeData; - } - - /** - * Sets the merge data. Can be an array of {@link java.util.HashMap} objects or an array of objects - * which can be serialized to JSON by GSON. - * - * @param mergeData The merge data. - */ - public void setMergeData(Object[] mergeData) throws InvalidParameterException { - if (mergeData == null) { - throw new InvalidParameterException("mergeData must not be null."); - } - if (mergeData.length == 0) { - throw new InvalidParameterException("mergeData must not be empty."); - } - this._mergeData = Arrays.asList(mergeData); - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/MergeField.java b/src/main/java/com/textcontrol/reportingcloud/MergeField.java deleted file mode 100644 index 3e860f3..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/MergeField.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * Represents a merge field in a document template. - * - * @author Thorsten Kummerow - */ -public class MergeField { - private final String _dateTimeFormat; - private final String _name; - private final String _numericFormat; - private final boolean _bPreserveFormatting; - private final String _text; - private final String _textAfter; - private final String _textBefore; - - - public MergeField(String dateTimeFormat, String name, String numericFormat, boolean preserveFormatting, String text, String textAfter, String textBefore) { - this._dateTimeFormat = dateTimeFormat; - this._name = name; - this._numericFormat = numericFormat; - this._bPreserveFormatting = preserveFormatting; - this._text = text; - this._textAfter = textAfter; - this._textBefore = textBefore; - } - - /** - * Returns the format which is applied to date / time values. - * - * @return The format which is applied to date / time values. - */ - public String getDateTimeFormat() { - return _dateTimeFormat; - } - - /** - * Returns the name of the field. - * - * @return The name of the field. - */ - public String getName() { - return _name; - } - - /** - * Returns the format which is applied to numeric values. - * - * @return The format which is applied to numeric values. - */ - public String getNumericFormat() { - return _numericFormat; - } - - /** - * Returns whether formatting is preserved. - * - * @return Returns whether formatting is preserved. - */ - public boolean getPreserveFormatting() { - return _bPreserveFormatting; - } - - /** - * Returns the field text. - * - * @return The field text. - */ - public String getText() { - return _text; - } - - /** - * Returns the text after the field. - * - * @return The text after the field. - */ - public String getTextAfter() { - return _textAfter; - } - - /** - * Returns the text before the field. - * - * @return The text before the field. - */ - public String getTextBefore() { - return _textBefore; - } - -} diff --git a/src/main/java/com/textcontrol/reportingcloud/MergeSettings.java b/src/main/java/com/textcontrol/reportingcloud/MergeSettings.java deleted file mode 100644 index b75f8d8..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/MergeSettings.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -/** - * Holds the merge settings needed by the {@link com.textcontrol.reportingcloud.ReportingCloud#mergeDocument mergeDocument} - * method. - * - * @author Thorsten Kummerow - */ -public class MergeSettings extends DocumentSettings { - private boolean _removeEmptyFields; - private boolean _removeEmptyBlocks; - private boolean _removeEmptyImages; - private boolean _removeTrailingWhitespace; - private boolean _mergeHtml; - - public MergeSettings() { - this._removeEmptyFields = true; - this._removeEmptyBlocks = true; - this._removeEmptyImages = true; - this._removeTrailingWhitespace = true; - this._mergeHtml = false; - } - - /** - * Gets whether empty fields should be removed from the template or not. - * - * @return Empty fields should be removed. - */ - public boolean getRemoveEmptyFields() { - return _removeEmptyFields; - } - - /** - * Sets whether empty fields should be removed from the template or not. - * - * @param removeEmptyFields Empty fields should be removed or not. - */ - public void setRemoveEmptyFields(boolean removeEmptyFields) { - this._removeEmptyFields = removeEmptyFields; - } - - /** - * Gets whether the content of empty merge blocks should be removed from the template - * or not. - * - * @return The content of empty merge blocks should be removed. - */ - public boolean getRemoveEmptyBlocks() { - return _removeEmptyBlocks; - } - - /** - * Sets whether the content of empty merge blocks should be removed from the template - * or not. - * - * @param removeEmptyBlocks The content of empty merge blocks should be removed - * from the template or not. - */ - public void setRemoveEmptyBlocks(boolean removeEmptyBlocks) { - this._removeEmptyBlocks = removeEmptyBlocks; - } - - /** - * Gets whether images which don't have merge data should be removed from - * the template or not. - * - * @return The images which don't have merge data should be removed. - */ - public boolean getRemoveEmptyImages() { - return _removeEmptyImages; - } - - /** - * Sets whether images which don't have merge data should be removed from - * the template or not. - * - * @param removeEmptyImages Images which don't have merge data should be - * removed from the template or not. - */ - public void setRemoveEmptyImages(boolean removeEmptyImages) { - this._removeEmptyImages = removeEmptyImages; - } - - /** - * Gets whether trailing whitespace should be removed before saving a document. - * - * @return Trailing whitespace should be removed. - */ - public boolean getRemoveTrailingWhitespace() { - return _removeTrailingWhitespace; - } - - /** - * Sets whether trailing whitespace should be removed before saving a document. - * - * @param removeTrailingWhitespace Trailing whitespace should be removed before - * saving a document. - */ - public void setRemoveTrailingWhitespace(boolean removeTrailingWhitespace) { - this._removeTrailingWhitespace = removeTrailingWhitespace; - } - - /** - * Returns whether field data can contain formatted Html content or not. - * - * @return Field data can contain formatted Html content or not. - */ - public boolean getMergeHtml() { - return this._mergeHtml; - } - - /** - * Sets whether field data can contain formatted Html content or not. - * - * @param mergeHtml Field data can contain formatted Html content or not. - */ - public void setMergeHtml(boolean mergeHtml) { - this._mergeHtml = mergeHtml; - } -} diff --git a/src/main/java/com/textcontrol/reportingcloud/ReportingCloud.java b/src/main/java/com/textcontrol/reportingcloud/ReportingCloud.java deleted file mode 100644 index 0cdfcbc..0000000 --- a/src/main/java/com/textcontrol/reportingcloud/ReportingCloud.java +++ /dev/null @@ -1,885 +0,0 @@ -/** - * ReportingCloud Java SDK - * - * Official Java SDK for the ReportingCloud Web API. Authored, maintained and fully supported - * by Text Control GmbH. (http://www.textcontrol.com). - * - * Go to http://www.reporting.cloud to learn more about ReportingCloud - * Go to https://github.com/TextControl/txtextcontrol-reportingcloud-java for the - * canonical source repository. - * - * License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-java/master/LICENSE.md - * - * Copyright: © 2019 Text Control GmbH - */ -package com.textcontrol.reportingcloud; - -import java.io.*; -import java.net.*; -import java.security.InvalidParameterException; -import java.util.*; -import java.util.stream.Collectors; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; -import com.textcontrol.reportingcloud.gson.*; - -/** - * The ReportingCloud Java SDK main class. - * - * @author Thorsten Kummerow - */ -public class ReportingCloud { - - private static final String DEFAULT_BASE_URL = "https://api.reporting.cloud"; - private static final String DEFAULT_VERSION = "v1"; - private static final int DEFAULT_TIMEOUT = 10; - private static final String USER_AGENT = "Mozilla/5.0"; - private Gson _gson; - - private String _username; - private String _password; - private String _baseUrl; - private String _version; - - /** - * Creates a new instance. - * - * @param username The username. - * @param password The password. - * @param baseUrl The API base URL. - */ - public ReportingCloud(String username, String password, String baseUrl) { - _username = username; - _password = password; - _baseUrl = baseUrl; - // Remove possible slash at the end of base url - if (_baseUrl.endsWith("/")) _baseUrl = _baseUrl.substring(0, _baseUrl.length() - 2); - _version = DEFAULT_VERSION; - - // Register custom JSON deserializers and create json parser instance - GsonBuilder gb = new GsonBuilder(); - gb.registerTypeAdapter(Template.class, new TemplateDeserializer()); - gb.registerTypeAdapter(AccountSettings.class, new AccountSettingsDeserializer()); - gb.registerTypeAdapter(IncorrectWord.class, new IncorrectWordDeserializer()); - gb.registerTypeAdapter(MergeSettings.class, new MergeSettingsSerializer()); - gb.registerTypeAdapter(MergeBody.class, new MergeBodySerializer()); - gb.registerTypeAdapter(TemplateInfo.class, new TemplateInfoDeserializer()); - gb.registerTypeAdapter(FindAndReplaceBody.class, new FindAndReplaceBodySerializer()); - gb.registerTypeAdapter(APIKey.class, new APIKeyDeserializer()); - gb.registerTypeAdapter(AppendBody.class, new AppendBodySerializer()); - gb.serializeNulls(); - _gson = gb.create(); - } - - /** - * Creates a new instance with the API base URL set to - * "https://api.reporting.cloud". - * - * @param username The username. - * @param password The password. - */ - public ReportingCloud(String username, String password) { - this(username, password, DEFAULT_BASE_URL); - } - - /** - * Returns the number of templates in the template storage. - * - * @return The number of templates in the template storage. - * @throws IOException If an I/O error occurs. - * @throws IllegalArgumentException If something went wrong concerning the HTTP request. - */ - public int getTemplateCount() throws IllegalArgumentException, IOException { - String res = request(ReqType.GET, "/templates/count"); - return Integer.parseInt(res); - } - - /** - * Gets the current user's account settings. - * - * @return The account settings. - * @throws IOException If an I/O error occurs. - * @throws IllegalArgumentException If something went wrong concerning the HTTP request. - */ - public AccountSettings getAccountSettings() throws IllegalArgumentException, IOException { - String res = request(ReqType.GET, "/account/settings"); - return _gson.fromJson(res, AccountSettings.class); - } - - /** - * Lists all templates from the template storage. - * - * @return A list of Template objects. - * @throws IllegalArgumentException If something went wrong concerning the HTTP request. - * @throws IOException If an I/O error occurs. - */ - public List