Nexacro N XAPI Spring boot
This commit is contained in:
38
.gitignore
vendored
Normal file
38
.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
logs/
|
||||||
|
src/main/resources/static/export/
|
||||||
|
src/main/resources/static/import/
|
||||||
|
src/main/resources/static/upload/
|
||||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007-present the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed 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
|
||||||
|
*
|
||||||
|
* https://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.
|
||||||
|
*/
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.6";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if(mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if(!outputFile.getParentFile().exists()) {
|
||||||
|
if(!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||||
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# https://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.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=`java-config --jre-home`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ] ; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
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
|
||||||
|
|
||||||
|
saveddir=`pwd`
|
||||||
|
|
||||||
|
M2_HOME=`dirname "$PRG"`/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="`which javac`"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=`which readlink`
|
||||||
|
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||||
|
fi
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
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
|
||||||
|
else
|
||||||
|
JAVACMD="`which java`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=`cd "$wdir/.."; pwd`
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' < "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
@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 https://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 ----------------------------------------------------------------------------
|
||||||
|
@REM Maven Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
||||||
113
pom.xml
Normal file
113
pom.xml
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<relativePath/>
|
||||||
|
<!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.tobesoft.overseas</groupId>
|
||||||
|
<artifactId>nexacro-demo</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<name>nexacro-demo</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>11</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- dependency for nexacro xapi -->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.googlecode.json-simple</groupId>
|
||||||
|
<artifactId>json-simple</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nexacro</groupId>
|
||||||
|
<artifactId>nexacro-xapi-java</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/src/main/resources/lib/nexacro-xapi-java-1.0.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- dependency for nexacro xeni {poi and others} -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nexacro</groupId>
|
||||||
|
<artifactId>nexacro-xeni-java</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/src/main/resources/lib/nexacro-xeni-java-1.0.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- poi -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-scratchpad</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- other dependency -->
|
||||||
|
<!-- commons-fileupload original version 1.3.1 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-fileupload</groupId>
|
||||||
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
<version>1.4</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- dom4j original version 1.6.1 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dom4j</groupId>
|
||||||
|
<artifactId>dom4j</artifactId>
|
||||||
|
<version>2.1.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- omitted for duplicate. It's used by nexacro-xapi-->
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>com.googlecode.json-simple</groupId>
|
||||||
|
<artifactId>json-simple</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency> -->
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class NexacroDemoApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(NexacroDemoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.config;
|
||||||
|
|
||||||
|
import javax.servlet.Filter;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||||
|
import org.springframework.web.filter.CorsFilter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MyCorsConfiguration {
|
||||||
|
@Bean
|
||||||
|
public FilterRegistrationBean<Filter> corsFilter() {
|
||||||
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||||
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
|
config.setAllowCredentials(true);
|
||||||
|
config.addAllowedOrigin("http://127.0.0.1:4098");
|
||||||
|
config.addAllowedOrigin("http://localhost:4098");
|
||||||
|
config.addAllowedHeader("*");
|
||||||
|
config.addAllowedMethod("*");
|
||||||
|
source.registerCorsConfiguration("/**", config);
|
||||||
|
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<Filter>(new CorsFilter(source));
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.config;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import javax.servlet.Servlet;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
|
||||||
|
import com.nexacro.java.xeni.services.GridExportImportServlet;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
||||||
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class NexacroXeniConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ServletContextInitializer initializer() {
|
||||||
|
return new ServletContextInitializer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartup(ServletContext servletContext) throws ServletException {
|
||||||
|
// set nexacro-xeni context params
|
||||||
|
String realPath = new File("src/main/resources/static").getAbsolutePath();
|
||||||
|
String exportPath = "file://" + realPath + "\\export";
|
||||||
|
String importPath = "file://" + realPath + "\\import";
|
||||||
|
|
||||||
|
servletContext.setInitParameter("export-path", exportPath);
|
||||||
|
servletContext.setInitParameter("import-path", importPath);
|
||||||
|
servletContext.setInitParameter("monitor-enabled", "true");
|
||||||
|
servletContext.setInitParameter("monitor-cycle-time", "5");
|
||||||
|
servletContext.setInitParameter("file-storage-time", "3");
|
||||||
|
servletContext.setInitParameter("numFmt-lang", "ko");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ServletRegistrationBean<Servlet> nexacroExcelExportImportServletRegistrationBean() {
|
||||||
|
return new ServletRegistrationBean<Servlet>(new GridExportImportServlet(), "/XExportImport", "/XImport");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.core.io.ResourceLoader;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class DownloadStaticFile {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(DownloadStaticFile.class);
|
||||||
|
|
||||||
|
private final ResourceLoader resourceLoader;
|
||||||
|
|
||||||
|
public DownloadStaticFile(ResourceLoader resourceLoader) {
|
||||||
|
this.resourceLoader = resourceLoader;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/download/{fileName:.*}")
|
||||||
|
public ResponseEntity<Resource> resouceFileDownload(@PathVariable String fileName) throws IOException {
|
||||||
|
|
||||||
|
log.debug("fileName {} ", fileName);
|
||||||
|
Resource resource = resourceLoader.getResource("classpath:static/"+ fileName);
|
||||||
|
|
||||||
|
String mimeType = URLConnection.guessContentTypeFromName(resource.getFilename());
|
||||||
|
|
||||||
|
if (mimeType == null) {
|
||||||
|
mimeType = "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpHeaders header = new HttpHeaders();
|
||||||
|
header.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"");
|
||||||
|
header.add(HttpHeaders.CONTENT_LENGTH, resource.contentLength() + "");
|
||||||
|
header.add(HttpHeaders.CONTENT_TYPE, mimeType);
|
||||||
|
|
||||||
|
return ResponseEntity.ok()
|
||||||
|
.headers(header)
|
||||||
|
.contentLength(resource.contentLength())
|
||||||
|
.contentType(MediaType.parseMediaType(mimeType))
|
||||||
|
.body(resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @PostMapping("/download/{fileName:.*}")
|
||||||
|
// public void resouceFileDownload(@PathVariable String fileName, HttpServletResponse response) throws IOException {
|
||||||
|
|
||||||
|
// log.debug("fileName {} ", fileName);
|
||||||
|
// Resource resource = resourceLoader.getResource("classpath:static/"+ fileName);
|
||||||
|
|
||||||
|
// if(resource.exists()) {
|
||||||
|
|
||||||
|
// String mimeType = URLConnection.guessContentTypeFromName(resource.getFilename());
|
||||||
|
|
||||||
|
// if (mimeType == null) {
|
||||||
|
// mimeType = "application/octet-stream";
|
||||||
|
// }
|
||||||
|
// System.out.println("file name::: " + fileName + " mimeType::: " + mimeType);
|
||||||
|
// response.setContentType(mimeType);
|
||||||
|
// response.setHeader("Content-Disposition", String.format("attachment; filename=\"" + resource.getFilename()) + "\"");
|
||||||
|
// response.setContentLength((int) resource.contentLength());
|
||||||
|
|
||||||
|
// InputStream inputStream = resource.getInputStream();
|
||||||
|
// FileCopyUtils.copy(inputStream, response.getOutputStream());
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.nexacro.java.xapi.data.DataSet;
|
||||||
|
import com.nexacro.java.xapi.data.DataSetList;
|
||||||
|
import com.nexacro.java.xapi.data.DataTypes;
|
||||||
|
import com.nexacro.java.xapi.data.PlatformData;
|
||||||
|
import com.nexacro.java.xapi.data.VariableList;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformException;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformRequest;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformResponse;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformType;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RequestMapping("/services/nexacroapi")
|
||||||
|
@RestController
|
||||||
|
public class NexacroApiSampleController {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(NexacroApiSampleController.class);
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public void getDataNexacroApiSampleController(HttpServletRequest request, HttpServletResponse response) throws IOException, PlatformException {
|
||||||
|
|
||||||
|
String strCharset = "utf-8";
|
||||||
|
//String platformType = PlatformType.CONTENT_TYPE_SSV;
|
||||||
|
String platformType = PlatformType.CONTENT_TYPE_XML;
|
||||||
|
|
||||||
|
PlatformRequest platformRequest = new PlatformRequest(request.getInputStream(), platformType, strCharset);
|
||||||
|
platformRequest.receiveData();
|
||||||
|
PlatformData pd = platformRequest.getData();
|
||||||
|
log.debug("GET dataset count {} variable count {}", pd.getDataSetCount(), pd.getVariableCount());
|
||||||
|
|
||||||
|
PlatformResponse platformResponse = new PlatformResponse(response.getOutputStream(), platformType, strCharset);
|
||||||
|
PlatformData outPD = platformRequest.getData();
|
||||||
|
VariableList outVariableList = new VariableList();
|
||||||
|
DataSetList outDataSetList = new DataSetList();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
DataSet outDataSet0 = new DataSet("output");
|
||||||
|
outDataSet0.addColumn("Column0", DataTypes.STRING, 20);
|
||||||
|
outDataSet0.addColumn("Column1", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column2", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column3", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column4", DataTypes.STRING, 256);
|
||||||
|
|
||||||
|
int nRow = outDataSet0.newRow();
|
||||||
|
outDataSet0.set(nRow, "Column0", "테스트");
|
||||||
|
nRow = outDataSet0.newRow();
|
||||||
|
outDataSet0.set(nRow, "Column0", "테스트");
|
||||||
|
|
||||||
|
|
||||||
|
outDataSetList.add(outDataSet0);
|
||||||
|
|
||||||
|
outVariableList.add("ErrorCode", 0);
|
||||||
|
outVariableList.add("ErrorMsg", "Success");
|
||||||
|
outVariableList.add("argTest", "variable id");
|
||||||
|
|
||||||
|
|
||||||
|
} catch(Exception e) {
|
||||||
|
|
||||||
|
outVariableList.add("ErrorMsg", e);
|
||||||
|
outVariableList.add("ErrorCode", -1);
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
outPD.setDataSetList(outDataSetList);
|
||||||
|
outPD.setVariableList(outVariableList);
|
||||||
|
platformResponse.setData(outPD);
|
||||||
|
platformResponse.sendData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
public void postDataNexacroApiSampleController(HttpServletRequest request, HttpServletResponse response) throws IOException, PlatformException {
|
||||||
|
|
||||||
|
String strCharset = "utf-8";
|
||||||
|
//String platformType = PlatformType.CONTENT_TYPE_SSV;
|
||||||
|
String platformType = PlatformType.CONTENT_TYPE_XML;
|
||||||
|
|
||||||
|
PlatformRequest platformRequest = new PlatformRequest(request.getInputStream(), platformType, strCharset);
|
||||||
|
platformRequest.receiveData();
|
||||||
|
PlatformData inPD = platformRequest.getData();
|
||||||
|
log.info("POST dataset count {} variable count {}", inPD.getDataSetCount(), inPD.getVariableCount());
|
||||||
|
|
||||||
|
DataSetList inDatdasetList = null;
|
||||||
|
VariableList inVariableList = null;
|
||||||
|
|
||||||
|
if(inPD.getDataSetCount() > 0) inDatdasetList = inPD.getDataSetList();
|
||||||
|
if(inPD.getVariableCount() > 0) inVariableList = inPD.getVariableList();
|
||||||
|
|
||||||
|
log.info("Datast List {} Variable List {}", inDatdasetList, inVariableList);
|
||||||
|
|
||||||
|
PlatformResponse platformResponse = new PlatformResponse(response.getOutputStream(), platformType, strCharset);
|
||||||
|
PlatformData outPD = new PlatformData();
|
||||||
|
VariableList outVariableList = outPD.getVariableList();
|
||||||
|
DataSetList outDataSetList = outPD.getDataSetList();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
DataSet outDataSet0 = new DataSet("output");
|
||||||
|
outDataSet0.addColumn("Column0", DataTypes.STRING, 20);
|
||||||
|
outDataSet0.addColumn("Column1", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column2", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column3", DataTypes.STRING, 256);
|
||||||
|
outDataSet0.addColumn("Column4", DataTypes.STRING, 256);
|
||||||
|
|
||||||
|
int nRow = outDataSet0.newRow();
|
||||||
|
outDataSet0.set(nRow, "Column0", "테스트");
|
||||||
|
nRow = outDataSet0.newRow();
|
||||||
|
outDataSet0.set(nRow, "Column0", "테스트");
|
||||||
|
|
||||||
|
|
||||||
|
outDataSetList.add(outDataSet0);
|
||||||
|
|
||||||
|
outVariableList.add("ErrorCode", 0);
|
||||||
|
outVariableList.add("ErrorMsg", "Success");
|
||||||
|
outVariableList.add("argTest", "variable id");
|
||||||
|
|
||||||
|
|
||||||
|
} catch(Exception e) {
|
||||||
|
|
||||||
|
outVariableList.add("ErrorMsg", e);
|
||||||
|
outVariableList.add("ErrorCode", -1);
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
outPD.setDataSetList(outDataSetList);
|
||||||
|
outPD.setVariableList(outVariableList);
|
||||||
|
platformResponse.setData(outPD);
|
||||||
|
platformResponse.sendData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
// ctrl + shift + o
|
||||||
|
@RestController
|
||||||
|
public class NexacroCheckLicenseController {
|
||||||
|
@GetMapping("/services/license")
|
||||||
|
public void getNexacroLicenseInfo(HttpServletResponse response) throws IOException {
|
||||||
|
OutputStream out = response.getOutputStream();
|
||||||
|
new com.nexacro.java.xapi.util.JarInfo().info(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,373 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.nexacro.java.xapi.data.ColumnHeader;
|
||||||
|
import com.nexacro.java.xapi.data.DataSet;
|
||||||
|
import com.nexacro.java.xapi.data.DataTypes;
|
||||||
|
import com.nexacro.java.xapi.data.PlatformData;
|
||||||
|
import com.nexacro.java.xapi.data.VariableList;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformException;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformRequest;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformResponse;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformType;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class NexacroFileUploadDownloadControl {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(NexacroFileUploadDownloadControl.class);
|
||||||
|
|
||||||
|
private static final String SP = File.separator;
|
||||||
|
private static final String PATH = "upload";
|
||||||
|
private static final String CHAR_SET = "UTF-8";
|
||||||
|
|
||||||
|
|
||||||
|
private String getFilePath(String userFolder) {
|
||||||
|
String realPath = new File("src/main/resources/static").getAbsolutePath();
|
||||||
|
String uploadPath = realPath + SP + PATH + SP + userFolder;
|
||||||
|
log.debug(uploadPath);
|
||||||
|
File extFolder = new File(uploadPath);
|
||||||
|
if(!extFolder.exists()) {
|
||||||
|
extFolder.mkdirs();
|
||||||
|
}
|
||||||
|
return uploadPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addFiles(List<File> files, File f) {
|
||||||
|
if(f.isDirectory()) {
|
||||||
|
File[] listFiles = f.listFiles();
|
||||||
|
assert listFiles != null;
|
||||||
|
for(File file: listFiles) {
|
||||||
|
addFiles(files, file);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (f.isFile()){
|
||||||
|
files.add(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendPlatformData(HttpServletResponse response, DataSet ds) throws IOException, PlatformException {
|
||||||
|
String platformType = PlatformType.CONTENT_TYPE_XML;
|
||||||
|
PlatformResponse platformResponse = new PlatformResponse(response.getOutputStream(), platformType, CHAR_SET);
|
||||||
|
PlatformData resData = new PlatformData();
|
||||||
|
VariableList resVarList = resData.getVariableList();
|
||||||
|
|
||||||
|
resVarList.add("ErrorCode", 0);
|
||||||
|
resVarList.add("ErrorMsg", "Success" );
|
||||||
|
resData.addDataSet(ds);
|
||||||
|
platformResponse.setData(resData);
|
||||||
|
platformResponse.sendData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/services/downloadFileList" )
|
||||||
|
public void searchFiles(HttpServletRequest request, HttpServletResponse response) throws IOException, PlatformException {
|
||||||
|
|
||||||
|
PlatformRequest platformRequest = new PlatformRequest(request.getInputStream(), PlatformType.CONTENT_TYPE_XML, CHAR_SET);
|
||||||
|
platformRequest.receiveData();
|
||||||
|
PlatformData inPD = platformRequest.getData();
|
||||||
|
VariableList inVariableList = inPD.getVariableList();
|
||||||
|
|
||||||
|
String userFileFolder = inVariableList.getString("filefolder");
|
||||||
|
String uploadPath = getFilePath(userFileFolder);
|
||||||
|
String url = request.getRequestURL().substring(0, request.getRequestURL().lastIndexOf("/services")) + "/" + PATH + "/" +userFileFolder + "/";
|
||||||
|
|
||||||
|
List<File> fileList = new ArrayList<>();
|
||||||
|
File directory = new File(uploadPath);
|
||||||
|
addFiles(fileList, directory);
|
||||||
|
|
||||||
|
DataSet ds = new DataSet("dsList");
|
||||||
|
ds.addColumn("FILE_NAME", DataTypes.STRING, 255);
|
||||||
|
ds.addColumn("FILE_URL", DataTypes.STRING, 255);
|
||||||
|
ds.addColumn("FiLE_SIZE", DataTypes.STRING, 255);
|
||||||
|
|
||||||
|
for(File file: fileList) {
|
||||||
|
int newRow = ds.newRow();
|
||||||
|
ds.set(newRow, "FILE_NAME", file.getName());
|
||||||
|
ds.set(newRow, "FILE_URL", url + file.getName());
|
||||||
|
ds.set(newRow, "FiLE_SIZE", file.length());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sendPlatformData(response, ds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/services/uploadFile")
|
||||||
|
public void uploadFiles(@RequestParam("filefolder") String userFileFolder, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
if(!(request instanceof MultipartHttpServletRequest)) {
|
||||||
|
|
||||||
|
log.debug("Request is not a MultipartHttpServletRequest");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
|
|
||||||
|
// parameter and multipart parameter
|
||||||
|
//Enumeration<String> parameterNames = multipartRequest.getParameterNames();
|
||||||
|
|
||||||
|
// files..
|
||||||
|
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||||
|
if(fileMap.isEmpty()) {
|
||||||
|
String errmsg = "No upload file";
|
||||||
|
DataSet dsError = new DataSet("ds_error");
|
||||||
|
dsError.addColumn(new ColumnHeader("ErrorMsg", DataTypes.STRING));
|
||||||
|
dsError.addColumn(new ColumnHeader("ErrorCode", DataTypes.LONG));
|
||||||
|
|
||||||
|
dsError.set(dsError.newRow(), "ErrorCode", -1);
|
||||||
|
dsError.set(dsError.newRow(), "ErrorMsg", errmsg);
|
||||||
|
sendPlatformData(response, dsError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String filePath = getFilePath(userFileFolder);
|
||||||
|
Set<String> keySet = fileMap.keySet();
|
||||||
|
|
||||||
|
DataSet ds = new DataSet("filefolder");
|
||||||
|
ds.addColumn(new ColumnHeader("fileName", DataTypes.STRING));
|
||||||
|
ds.addColumn(new ColumnHeader("fileSize", DataTypes.LONG));
|
||||||
|
ds.addColumn(new ColumnHeader("fileType", DataTypes.STRING));
|
||||||
|
ds.addColumn(new ColumnHeader("savePath", DataTypes.STRING));
|
||||||
|
ds.addColumn(new ColumnHeader("orgName", DataTypes.STRING));
|
||||||
|
int row;
|
||||||
|
for(String name: keySet) {
|
||||||
|
|
||||||
|
MultipartFile multipartFile = fileMap.get(name);
|
||||||
|
String originalFilename = multipartFile.getOriginalFilename();
|
||||||
|
//String fileName = new Date().getTime() + PREFIX + originalFilename;
|
||||||
|
String fileName = originalFilename;
|
||||||
|
String type = multipartFile.getContentType();
|
||||||
|
//File destination = File.createTempFile(PREFIX, originalFilename, new File(filePath));
|
||||||
|
Boolean isExistFile = new File(filePath + SP + fileName).exists();
|
||||||
|
if(isExistFile) {
|
||||||
|
fileName = new Date().getTime() + "_" + originalFilename;
|
||||||
|
}
|
||||||
|
File destination = new File(filePath + SP + fileName);
|
||||||
|
multipartFile.transferTo(destination);
|
||||||
|
String url = request.getRequestURL().substring(0, request.getRequestURL().lastIndexOf("/services")) + "/" + PATH + "/" +userFileFolder + "/";
|
||||||
|
row = ds.newRow(0);
|
||||||
|
ds.set(row, "fileName", fileName);
|
||||||
|
ds.set(row, "fileSize", destination.length());
|
||||||
|
ds.set(row, "fileType", type);
|
||||||
|
ds.set(row, "savePath", url + fileName);
|
||||||
|
ds.set(row, "orgName", originalFilename);
|
||||||
|
|
||||||
|
log.debug("uploaded file write success. file="+originalFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
sendPlatformData(response, ds);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.debug(e.getMessage());
|
||||||
|
DataSet dsError = new DataSet("ds_error");
|
||||||
|
dsError.addColumn(new ColumnHeader("ErrorMsg", DataTypes.STRING));
|
||||||
|
dsError.addColumn(new ColumnHeader("ErrorCode", DataTypes.LONG));
|
||||||
|
|
||||||
|
dsError.set(dsError.newRow(), "ErrorCode", -1);
|
||||||
|
dsError.set(dsError.newRow(), "ErrorMsg", e.getMessage());
|
||||||
|
|
||||||
|
sendPlatformData(response, dsError);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/services/downloadFile")
|
||||||
|
public void downloadFile(HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@RequestParam("filename") String fileName,
|
||||||
|
@RequestParam("filefolder") String fileFolder) throws Exception {
|
||||||
|
|
||||||
|
String characterEncoding = request.getCharacterEncoding();
|
||||||
|
if(characterEncoding == null) {
|
||||||
|
characterEncoding = PlatformType.DEFAULT_CHAR_SET;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileName = new String(fileName.getBytes("iso8859-1"), characterEncoding);
|
||||||
|
|
||||||
|
fileName = fileName.replace("/", "");
|
||||||
|
fileName = fileName.replace("\\", "");
|
||||||
|
// fileName = fileName.replace(".", "");
|
||||||
|
fileName = fileName.replace("&", "");
|
||||||
|
|
||||||
|
String downloadFilePath = getFilePath(fileFolder);
|
||||||
|
String realFileName = downloadFilePath + SP + fileName;
|
||||||
|
// already decode..
|
||||||
|
// String decodedFileName = URLDecoder.decode(realFileName, "utf-8");
|
||||||
|
|
||||||
|
File file = new File(realFileName);
|
||||||
|
|
||||||
|
// default - application/octet-stream
|
||||||
|
// result.setContentType(contentType); // set MIME TYPE
|
||||||
|
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
|
||||||
|
ServletOutputStream out_stream = null;
|
||||||
|
BufferedInputStream in_stream = null;
|
||||||
|
|
||||||
|
if(file.exists())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.setContentType("application/octet;charset=utf-8");
|
||||||
|
//response.setHeader("Content-Disposition", "attachment; filename = \"" + filename + "\"");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, CHAR_SET) + ";");
|
||||||
|
|
||||||
|
out_stream = response.getOutputStream();
|
||||||
|
in_stream = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
|
||||||
|
int n;
|
||||||
|
while ((n = in_stream.read(buffer, 0, 1024)) != -1)
|
||||||
|
{
|
||||||
|
out_stream.write(buffer, 0, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.debug("fileDownload filename==>"+fileName + ", Success. ");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (in_stream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
in_stream.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (out_stream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
out_stream.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log.error("fileDownload filename==>"+fileName + ", No file name.");
|
||||||
|
response.sendRedirect("unknownfile");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/services/downloadFileAll")
|
||||||
|
public void downloadFileAll(HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@RequestParam("filenamelist") String fileNameList,
|
||||||
|
@RequestParam("filefolder") String userFolder) {
|
||||||
|
|
||||||
|
String[] arrNameList = fileNameList.split(",");
|
||||||
|
|
||||||
|
ServletOutputStream out_stream = null;
|
||||||
|
BufferedInputStream in_stream = null;
|
||||||
|
ZipOutputStream zout_stream = null;
|
||||||
|
|
||||||
|
Date curDate = new Date();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.setContentType("application/octet;charset=utf-8");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename = \"" + userFolder + curDate.getTime() + ".zip" + "\"");
|
||||||
|
|
||||||
|
out_stream = response.getOutputStream();
|
||||||
|
zout_stream = new ZipOutputStream(out_stream);
|
||||||
|
zout_stream.setLevel(8);
|
||||||
|
|
||||||
|
String filename = "";
|
||||||
|
String filePath = "";
|
||||||
|
|
||||||
|
for( int i = 0; i < arrNameList.length; i++ ){
|
||||||
|
filename = new String(arrNameList[i].getBytes("iso8859-1"), "utf-8");
|
||||||
|
filePath = getFilePath(userFolder) + SP + filename;
|
||||||
|
File fis = new File(filePath);
|
||||||
|
in_stream = new BufferedInputStream(new FileInputStream(fis));
|
||||||
|
|
||||||
|
ZipEntry zentry = new ZipEntry(filename);
|
||||||
|
zentry.setTime(fis.lastModified());
|
||||||
|
zout_stream.putNextEntry(zentry);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int n;
|
||||||
|
while ((n = in_stream.read(buffer, 0, 1024)) != -1)
|
||||||
|
{
|
||||||
|
zout_stream.write(buffer, 0, n);
|
||||||
|
}
|
||||||
|
zout_stream.closeEntry();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (zout_stream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
zout_stream.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (out_stream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
out_stream.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (in_stream != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
in_stream.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.nexacro.java.xapi.data.DataSet;
|
||||||
|
import com.nexacro.java.xapi.data.DataSetList;
|
||||||
|
import com.nexacro.java.xapi.data.DataTypes;
|
||||||
|
import com.nexacro.java.xapi.data.PlatformData;
|
||||||
|
import com.nexacro.java.xapi.data.VariableList;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformException;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformRequest;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformResponse;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformType;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class NexacroLargeDataController {
|
||||||
|
|
||||||
|
@RequestMapping("/services/largeData")
|
||||||
|
public void getSsvData(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws IOException, PlatformException {
|
||||||
|
|
||||||
|
String strCharset = "utf-8";
|
||||||
|
String platformType = PlatformType.CONTENT_TYPE_SSV;
|
||||||
|
// String platformType = PlatformType.CONTENT_TYPE_XML;
|
||||||
|
|
||||||
|
PlatformRequest platformRequest = new PlatformRequest(request.getInputStream(), null);
|
||||||
|
platformRequest.receiveData();
|
||||||
|
|
||||||
|
PlatformData pd = platformRequest.getData();
|
||||||
|
VariableList vl = pd.getVariableList();
|
||||||
|
|
||||||
|
String rowCount = vl.getString("rowcount");
|
||||||
|
|
||||||
|
PlatformResponse platformResponse = new PlatformResponse(response.getOutputStream(), platformType, strCharset);
|
||||||
|
PlatformData outPD = platformRequest.getData();
|
||||||
|
VariableList outVariableList = new VariableList();
|
||||||
|
DataSetList outDataSetList = new DataSetList();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
DataSet outDataSet0 = new DataSet("output");
|
||||||
|
outDataSet0.addColumn("id", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("first_name", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("last_name", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("email", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("gender", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("ip_address", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("state", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("street", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("date", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("domain", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("guid", DataTypes.STRING, 50);
|
||||||
|
|
||||||
|
if (rowCount.equals("")) {
|
||||||
|
rowCount = "10000";
|
||||||
|
}
|
||||||
|
|
||||||
|
int nRow;
|
||||||
|
String path = new File("src/main/resources/dat/ssv_" + rowCount + ".dat").getAbsolutePath();
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader(path));
|
||||||
|
|
||||||
|
String line;
|
||||||
|
char a = (char) 0x1e;
|
||||||
|
char b = (char) 0x1f;
|
||||||
|
String RS = String.valueOf(a);
|
||||||
|
String US = String.valueOf(b);
|
||||||
|
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
String[] values = line.split(RS);
|
||||||
|
for (String str : values) {
|
||||||
|
String[] cols = str.split(US);
|
||||||
|
|
||||||
|
int colCnt = cols.length;
|
||||||
|
nRow = outDataSet0.newRow();
|
||||||
|
for (int i = 1; i < colCnt; i++) {
|
||||||
|
outDataSet0.set(nRow, i - 1, cols[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
|
||||||
|
// int nRow;
|
||||||
|
// if(rowcount == "") {
|
||||||
|
// rowcount = "100000";
|
||||||
|
// }
|
||||||
|
// int cnt = Integer.parseInt(rowcount);
|
||||||
|
// for(int i = 0; i < cnt; i++) {
|
||||||
|
//
|
||||||
|
// // Output Dataset add row
|
||||||
|
// nRow = outDataSet0.newRow();
|
||||||
|
//
|
||||||
|
// // set value to Output Dataset
|
||||||
|
// outDataSet0.set(nRow, "id", i+1);
|
||||||
|
// outDataSet0.set(nRow, "first_name", "Jack"+String.format("%06d", i));
|
||||||
|
// outDataSet0.set(nRow, "last_name", "Weaver");
|
||||||
|
// outDataSet0.set(nRow, "email", "jweaver0@elpais.com");
|
||||||
|
// outDataSet0.set(nRow, "gender", "Male");
|
||||||
|
// outDataSet0.set(nRow, "ip_address", "83.140.165.49");
|
||||||
|
// outDataSet0.set(nRow, "state", "Connecticut");
|
||||||
|
// outDataSet0.set(nRow, "street", "Rieder");
|
||||||
|
// outDataSet0.set(nRow, "date", "2016-07-08");
|
||||||
|
// outDataSet0.set(nRow, "domain", "icio.us");
|
||||||
|
// outDataSet0.set(nRow, "guid", "4a677fd8-1d06-4b53-9287-7612e1d793d3");
|
||||||
|
// }
|
||||||
|
|
||||||
|
outDataSetList.add(outDataSet0);
|
||||||
|
|
||||||
|
outVariableList.add("ErrorCode", 0);
|
||||||
|
outVariableList.add("ErrorMsg", "Success");
|
||||||
|
outVariableList.add("argTest", "variable id");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
outVariableList.add("ErrorMsg", e);
|
||||||
|
outVariableList.add("ErrorCode", -1);
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
outPD.setDataSetList(outDataSetList);
|
||||||
|
outPD.setVariableList(outVariableList);
|
||||||
|
platformResponse.setData(outPD);
|
||||||
|
platformResponse.sendData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo.controller;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.nexacro.java.xapi.data.DataSet;
|
||||||
|
import com.nexacro.java.xapi.data.DataSetList;
|
||||||
|
import com.nexacro.java.xapi.data.DataTypes;
|
||||||
|
import com.nexacro.java.xapi.data.PlatformData;
|
||||||
|
import com.nexacro.java.xapi.data.VariableList;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformException;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformRequest;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformResponse;
|
||||||
|
import com.nexacro.java.xapi.tx.PlatformType;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class NexacroPivotDataController {
|
||||||
|
@RequestMapping("/services/pivotData")
|
||||||
|
public void getSsvPivotDatar(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws IOException, PlatformException {
|
||||||
|
|
||||||
|
String strCharset = "utf-8";
|
||||||
|
String platformType = PlatformType.CONTENT_TYPE_SSV;
|
||||||
|
|
||||||
|
PlatformRequest platformRequest = new PlatformRequest(request.getInputStream(), null);
|
||||||
|
platformRequest.receiveData();
|
||||||
|
|
||||||
|
PlatformData pd = platformRequest.getData();
|
||||||
|
VariableList vl = pd.getVariableList();
|
||||||
|
|
||||||
|
String rowCount = vl.getString("rowcount");
|
||||||
|
|
||||||
|
PlatformResponse platformResponse = new PlatformResponse(response.getOutputStream(), platformType, strCharset);
|
||||||
|
PlatformData outPD = platformRequest.getData();
|
||||||
|
VariableList outVariableList = new VariableList();
|
||||||
|
DataSetList outDataSetList = new DataSetList();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
DataSet outDataSet0 = new DataSet("output");
|
||||||
|
outDataSet0.addColumn("col1", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col2", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col3", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col4", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col5", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col6", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col7", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col8", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col9", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col10", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col11", DataTypes.STRING, 50);
|
||||||
|
outDataSet0.addColumn("col12", DataTypes.INT, 8);
|
||||||
|
outDataSet0.addColumn("col13", DataTypes.INT, 8);
|
||||||
|
outDataSet0.addColumn("col14", DataTypes.INT, 8);
|
||||||
|
outDataSet0.addColumn("col15", DataTypes.INT, 8);
|
||||||
|
outDataSet0.addColumn("col16", DataTypes.INT, 8);
|
||||||
|
|
||||||
|
if (rowCount.equals("")) {
|
||||||
|
rowCount = "10000";
|
||||||
|
}
|
||||||
|
|
||||||
|
int nRow;
|
||||||
|
String path = new File("src/main/resources/dat/test" + rowCount + ".dat").getAbsolutePath();
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader(path));
|
||||||
|
|
||||||
|
String line;
|
||||||
|
char a = (char) 0x1e;
|
||||||
|
char b = (char) 0x1f;
|
||||||
|
String RS = String.valueOf(a);
|
||||||
|
String US = String.valueOf(b);
|
||||||
|
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
String[] values = line.split(RS);
|
||||||
|
for (String str : values) {
|
||||||
|
String[] cols = str.split(US);
|
||||||
|
|
||||||
|
int colCnt = cols.length;
|
||||||
|
nRow = outDataSet0.newRow();
|
||||||
|
for (int i = 1; i < colCnt; i++) {
|
||||||
|
outDataSet0.set(nRow, i - 1, cols[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
|
||||||
|
outDataSetList.add(outDataSet0);
|
||||||
|
|
||||||
|
outVariableList.add("ErrorCode", 0);
|
||||||
|
outVariableList.add("ErrorMsg", "Success");
|
||||||
|
outVariableList.add("argTest", "variable id");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
outVariableList.add("ErrorMsg", e);
|
||||||
|
outVariableList.add("ErrorCode", -1);
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
outPD.setDataSetList(outDataSetList);
|
||||||
|
outPD.setVariableList(outVariableList);
|
||||||
|
platformResponse.setData(outPD);
|
||||||
|
platformResponse.sendData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/main/resources/NexacroN_server_license.xml
Normal file
19
src/main/resources/NexacroN_server_license.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<license version="1.2">
|
||||||
|
<product>
|
||||||
|
<name>Nexacro N</name>
|
||||||
|
<version>21</version>
|
||||||
|
<function>Runtime,WebBrowser</function>
|
||||||
|
</product>
|
||||||
|
<customer>
|
||||||
|
<name>TOBE SOFTWARE</name>
|
||||||
|
<coreCount>0</coreCount>
|
||||||
|
<ipAddress>0.0.0.0</ipAddress>
|
||||||
|
<targetPlatform>Windows,WindowsRT,macOS,iOS,Android</targetPlatform>
|
||||||
|
</customer>
|
||||||
|
<date>
|
||||||
|
<activation>2021-08-01</activation>
|
||||||
|
<term unit="month">2</term>
|
||||||
|
</date>
|
||||||
|
<key>QXSSFSH5VKEMKZXBT869MNVF4TNK2WAYF</key>
|
||||||
|
</license>
|
||||||
3
src/main/resources/application.properties
Normal file
3
src/main/resources/application.properties
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
spring.output.ansi.enabled=always
|
||||||
|
logging.level.com.nexacro=debug
|
||||||
|
logging.level.com.tobesoft=debug
|
||||||
1
src/main/resources/dat/ssv_10000.dat
Normal file
1
src/main/resources/dat/ssv_10000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/ssv_100000.dat
Normal file
1
src/main/resources/dat/ssv_100000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/ssv_50000.dat
Normal file
1
src/main/resources/dat/ssv_50000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/test100000.dat
Normal file
1
src/main/resources/dat/test100000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/test200000.dat
Normal file
1
src/main/resources/dat/test200000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/test30000.dat
Normal file
1
src/main/resources/dat/test30000.dat
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/dat/test400000.dat
Normal file
1
src/main/resources/dat/test400000.dat
Normal file
File diff suppressed because one or more lines are too long
52
src/main/resources/error_en.properties
Normal file
52
src/main/resources/error_en.properties
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#=== GridCellStyleInfo
|
||||||
|
err.style.notfound.type=Can not find style type ({0} - {1})
|
||||||
|
err.style.limit.usercolor=User color is at the limit of 56. The color is fixed last user color.
|
||||||
|
#=== GridExportCsv
|
||||||
|
err.export.data.null=Export data is null.
|
||||||
|
err.export.dataset.null=Dataset is null.
|
||||||
|
err.export.fail.create.outstream=Fail to create output stream.
|
||||||
|
err.export.fail.create.extendclass=Could not create extend class - {0}
|
||||||
|
err.export.fault.bodyformat=The body format is fault - colum count of CELL dataset ({0}), body cell count of FORMAT ({1})
|
||||||
|
#=== GridExportExcel
|
||||||
|
#Export data is null.
|
||||||
|
#Dataset is null.
|
||||||
|
err.export.fail.create.filepath=Fail to create export file path.
|
||||||
|
err.export.fail.create.workbook=Fail to create workbook.
|
||||||
|
err.export.celldata.null=CellData object is null.
|
||||||
|
err.export.unsupported.celldata.type=CellData object type unsupported.
|
||||||
|
#err.fault.body.format=The body format is fault - colum count of CELL dataset ({0}), body cell count of FORMAT ({1})
|
||||||
|
err.export.cell.null=The cell in excel is null - row ({0}), col ({1})
|
||||||
|
#Could not create extend class - {0}
|
||||||
|
err.export.no.such.file=No such file or directory.
|
||||||
|
err.export.doc.encrypted=Unable to process - Document is encrypted.
|
||||||
|
#=== GridExportImportAgent
|
||||||
|
err.agent.no.data=Input data does not exist. Check the 'data-type' option of transaction
|
||||||
|
err.agent.not.exporttype=Not export type ({0})
|
||||||
|
err.agent.fail.create.exporter=Could not create Grid Exporter - export type (0x{0})
|
||||||
|
err.agent.request.data.null=Request data is null.
|
||||||
|
err.agent.command.data.null=Command data is null.
|
||||||
|
err.agent.not.importtype=Not import type ({0})
|
||||||
|
err.agent.invalid.filename=File name {0} is not valid.
|
||||||
|
err.agent.violate.security=The file name contains characters that violate security.
|
||||||
|
err.agent.fail.create.importer=Could not create Grid Importer.
|
||||||
|
err.agent.unsupported.format=Unsupported excel format.
|
||||||
|
err.agent.fail.excute.command=Could not excute command. ({0})
|
||||||
|
err.agent.invalid.export.key=Invalid export file key. ({0})
|
||||||
|
err.agent.fail.decode.name=Could not decode the name. ({0})
|
||||||
|
err.agent.invalid.filename=Invalid export file name. ({0})
|
||||||
|
err.agent.invalid.filetype=Invalid export file type. ({0})
|
||||||
|
err.agent.file.notfound=File not found. ({0})
|
||||||
|
#=== GridImportTypeFactory
|
||||||
|
err.import.require.password=Unable to process - Required password
|
||||||
|
err.import.doc.encrypted=Unable to process - Document is encrypted
|
||||||
|
#=== GridImportCSV
|
||||||
|
err.import.fail.close.stream=Fail to close for input stream.
|
||||||
|
err.import.path.empty=Import file path is empty.
|
||||||
|
err.import.no.such.file=No such file or directory.
|
||||||
|
#=== GridImportExcelHSSFEvent
|
||||||
|
#Import file path is empty.
|
||||||
|
err.import.sheet.notfound=Unable to process - Not found '{0}' sheet.
|
||||||
|
#=== GridImportExcelXSSFEvent
|
||||||
|
#Import file path is empty.
|
||||||
|
#Unable to process - Document is encrypted
|
||||||
|
#Unable to process - Not found '{0}' sheet.
|
||||||
35
src/main/resources/error_ko.properties
Normal file
35
src/main/resources/error_ko.properties
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
err.agent.command.data.null=command data\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.agent.fail.create.exporter=exporter\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 - export type (0x{0})
|
||||||
|
err.agent.fail.create.importer=importer\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4
|
||||||
|
err.agent.fail.decode.name=name\uC744 decode\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 ({0})
|
||||||
|
err.agent.fail.excute.command=command\uB97C \uC2E4\uD589\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 ({0})
|
||||||
|
err.agent.file.notfound=\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ({0})
|
||||||
|
err.agent.invalid.export.key=export file key\uAC00 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4
|
||||||
|
err.agent.invalid.filename=export file name\uC774 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. ({0})
|
||||||
|
err.agent.invalid.filetype=export file type\uC774 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 ({0})
|
||||||
|
err.agent.no.data=input data\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. Transaction\uC758 data-type\uC744 \uD655\uC778 \uD558\uC2ED\uC2DC\uC624
|
||||||
|
err.agent.not.exporttype=export type\uC774 \uC544\uB2D9\uB2C8\uB2E4 ({0})
|
||||||
|
err.agent.not.importtype=import type\uC774 \uC544\uB2D9\uB2C8\uB2E4. ({0})
|
||||||
|
err.agent.request.data.null=\uC694\uCCAD \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.agent.unsupported.format=\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 excel format \uC785\uB2C8\uB2E4.
|
||||||
|
err.agent.violate.security=file name\uC5D0 \uBCF4\uC548\uC5D0 \uC704\uBC30\uB418\uB294 \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4
|
||||||
|
err.export.cell.null=excel\uC758 cell\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 - row ({0}), col ({1})
|
||||||
|
err.export.celldata.null=cell data\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4
|
||||||
|
err.export.data.null=export data\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4
|
||||||
|
err.export.dataset.null=Dataset\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.export.doc.encrypted=\uCC98\uB9AC \uBD88\uAC00 - \uC554\uD638\uD654\uB41C \uBB38\uC11C\uC785\uB2C8\uB2E4
|
||||||
|
err.export.fail.create.extendclass=\uD655\uC7A5 \uD074\uB798\uC2A4\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 - ({0})
|
||||||
|
err.export.fail.create.filepath=export file path\uC0DD\uC131\uC5D0 \uC2E4\uD328 \uD588\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.export.fail.create.outstream=outstream\uC0DD\uC131\uC5D0 \uC2E4\uD328 \uD588\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.export.fail.create.workbook=workbook\uC0DD\uC131\uC5D0 \uC2E4\uD328 \uD588\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.export.fault.bodyformat=body format \uC624\uB958\uC785\uB2C8\uB2E4 - cell dataset colum \uAC1C\uC218({0}), format body cell \uAC1C\uC218({1})
|
||||||
|
err.export.no.such.file=\uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.export.unsupported.celldata.type=\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 object type \uC785\uB2C8\uB2E4.
|
||||||
|
err.import.doc.encrypted=\uCC98\uB9AC \uBD88\uAC00 - \uC554\uD638\uD654\uB41C \uBB38\uC11C\uC785\uB2C8\uB2E4
|
||||||
|
err.import.fail.close.stream=input stream close\uC5D0 \uC2E4\uD328 \uD588\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.import.no.such.file=\uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.import.path.empty=import file path\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.import.require.password=\uCC98\uB9AC \uBD88\uAC00 - \uBE44\uBC00\uBC88\uD638\uAC00 \uD544\uC694 \uD569\uB2C8\uB2E4.
|
||||||
|
err.import.sheet.notfound='{0}' sheet\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.style.limit.usercolor=\uC0AC\uC6A9\uC790 \uC0C9 \uC81C\uD55C\uC740 56 \uC785\uB2C8\uB2E4. \uC0C9\uC0C1\uC774 \uB9C8\uC9C0\uB9C9 \uC0AC\uC6A9\uC790 \uC0C9\uC73C\uB85C \uC218\uC815 \uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
||||||
|
err.style.notfound.type=stytle type\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 ({0} - {1})
|
||||||
35
src/main/resources/error_zh.properties
Normal file
35
src/main/resources/error_zh.properties
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
err.import.sheet.notfound=\u627E\u4E0D\u5230\u201C{0}\u201Dsheet\u3002
|
||||||
|
err.import.fail.close.stream=input stream close\u5931\u8D25\u3002
|
||||||
|
err.export.fault.bodyformat=body format\u9519\u8BEF - cell dataset colum\u4E2A\u6570({0})\uFF0Cformat body cell\u4E2A\u6570({1})
|
||||||
|
err.import.no.such.file=\u65E0\u6587\u4EF6\u6216\u76EE\u5F55\u3002
|
||||||
|
err.import.require.password=\u65E0\u6CD5\u5904\u7406 - \u9700\u8981\u5BC6\u7801\u3002
|
||||||
|
err.agent.request.data.null=\u65E0\u8BF7\u6C42\u6570\u636E\u3002
|
||||||
|
err.agent.file.notfound=\u627E\u4E0D\u5230\u6587\u4EF6\u3002({0})
|
||||||
|
err.agent.not.importtype=\u4E0D\u662Fimport type\u3002({0})
|
||||||
|
err.style.limit.usercolor=\u7528\u6237\u989C\u8272\u9650\u5236\u4E3A56\u3002\u989C\u8272\u53D8\u4E3A\u7528\u6237\u6700\u540E\u4F7F\u7528\u7684\u989C\u8272\u3002
|
||||||
|
err.export.fail.create.extendclass=\u65E0\u6CD5\u521B\u5EFA\u6269\u5C55\u7C7B - ({0})
|
||||||
|
err.import.doc.encrypted=\u65E0\u6CD5\u5904\u7406 - \u52A0\u5BC6\u6587\u4EF6
|
||||||
|
err.agent.invalid.export.key=export file key\u65E0\u6548\u3002
|
||||||
|
err.export.no.such.file=\u65E0\u6587\u4EF6\u6216\u76EE\u5F55\u3002
|
||||||
|
err.export.data.null=\u65E0export data\u3002
|
||||||
|
err.agent.invalid.filename=export file name\u65E0\u6548\u3002({0})
|
||||||
|
err.export.fail.create.workbook=workbook\u521B\u5EFA\u5931\u8D25\u3002
|
||||||
|
err.export.fail.create.outstream=outstream\u521B\u5EFA\u5931\u8D25\u3002
|
||||||
|
err.agent.command.data.null=\u65E0command data\u3002
|
||||||
|
err.export.fail.create.filepath=export file path\u521B\u5EFA\u5931\u8D25\u3002
|
||||||
|
err.style.notfound.type=\u627E\u4E0D\u5230stytle type({0} - {1})
|
||||||
|
err.import.path.empty=\u65E0import file path\u3002
|
||||||
|
err.agent.unsupported.format=\u4E0D\u652F\u6301\u7684excel format\u3002
|
||||||
|
err.agent.fail.excute.command=\u65E0\u6CD5\u8FD0\u884Ccommand({0})
|
||||||
|
err.agent.invalid.filetype=export file type \u65E0\u6548 ({0})
|
||||||
|
err.agent.violate.security=file name\u4E2D\u542B\u6709\u8FDD\u53CD\u5B89\u5168\u7684\u5B57\u7B26
|
||||||
|
err.agent.fail.create.exporter=\u65E0\u6CD5\u521B\u5EFAexporter - export type(0x{0})
|
||||||
|
err.export.unsupported.celldata.type=\u4E0D\u652F\u6301\u7684object type\u3002
|
||||||
|
err.export.doc.encrypted=\u65E0\u6CD5\u5904\u7406 - \u52A0\u5BC6\u6587\u4EF6
|
||||||
|
err.export.dataset.null=\u65E0Dataset\u3002
|
||||||
|
err.agent.not.exporttype=\u4E0D\u662Fexport type({0})
|
||||||
|
err.agent.no.data=\u65E0input data\u3002\u8BF7\u786E\u8BA4Transaction\u7684data-type\u3002
|
||||||
|
err.agent.fail.decode.name=\u65E0\u6CD5decode name({0})
|
||||||
|
err.export.celldata.null=\u65E0cell data
|
||||||
|
err.agent.fail.create.importer=\u65E0\u6CD5\u521B\u5EFAimporter
|
||||||
|
err.export.cell.null=\u65E0excel cell - row({0})\uFF0Ccol({1})
|
||||||
BIN
src/main/resources/lib/nexacro-xapi-java-1.0.0.jar
Normal file
BIN
src/main/resources/lib/nexacro-xapi-java-1.0.0.jar
Normal file
Binary file not shown.
BIN
src/main/resources/lib/nexacro-xeni-java-1.0.0.jar
Normal file
BIN
src/main/resources/lib/nexacro-xeni-java-1.0.0.jar
Normal file
Binary file not shown.
BIN
src/main/resources/static/ImportSample.xlsx
Normal file
BIN
src/main/resources/static/ImportSample.xlsx
Normal file
Binary file not shown.
@@ -0,0 +1,13 @@
|
|||||||
|
package com.tobesoft.overseas.nexacrodemo;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class NexacroDemoApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user