Commit fb25aca7 authored by Matija Obreza's avatar Matija Obreza

Dependencies updated

parent 47263d88
# #
# Build Genesys server on top of jetty-alpine # Build Genesys server on top of jetty-alpine
# #
FROM jetty:9.4.11 FROM jetty:9.4.12
LABEL maintainer "Matija Obreza <matija.obreza@croptrust.org>" LABEL maintainer "Matija Obreza <matija.obreza@croptrust.org>"
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<swagger.version>2.9.2</swagger.version> <swagger.version>2.9.2</swagger.version>
<!--Container --> <!--Container -->
<jetty.version>9.4.11.v20180605</jetty.version> <jetty.version>9.4.12.v20180830</jetty.version>
<maven.test.skip>false</maven.test.skip> <maven.test.skip>false</maven.test.skip>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId> <artifactId>commons-text</artifactId>
<version>1.4</version> <version>1.5</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.10</version> <version>1.11</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
<dependency> <dependency>
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId> <artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version> <version>2.3.2-b01</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
<dependency> <dependency>
<groupId>net.javacrumbs.shedlock</groupId> <groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId> <artifactId>shedlock-spring</artifactId>
<version>2.1.0</version> <version>2.2.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.javacrumbs.shedlock</groupId> <groupId>net.javacrumbs.shedlock</groupId>
...@@ -391,12 +391,12 @@ ...@@ -391,12 +391,12 @@
<dependency> <dependency>
<groupId>org.apache.tomcat</groupId> <groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId> <artifactId>tomcat-jdbc</artifactId>
<version>7.0.42</version> <version>7.0.47</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId> <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
<artifactId>owasp-java-html-sanitizer</artifactId> <artifactId>owasp-java-html-sanitizer</artifactId>
<version>r209</version> <version>r223</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security.oauth</groupId> <groupId>org.springframework.security.oauth</groupId>
...@@ -406,12 +406,12 @@ ...@@ -406,12 +406,12 @@
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.9.3</version> <version>2.9.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.1</version> <version>4.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
...@@ -444,7 +444,7 @@ ...@@ -444,7 +444,7 @@
<dependency> <dependency>
<groupId>org.jamel.dbf</groupId> <groupId>org.jamel.dbf</groupId>
<artifactId>dbf-reader</artifactId> <artifactId>dbf-reader</artifactId>
<version>0.1.0</version> <version>0.2.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -462,7 +462,7 @@ ...@@ -462,7 +462,7 @@
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId> <artifactId>spring-data-elasticsearch</artifactId>
<version>2.1.15.RELEASE</version> <version>2.1.16.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -484,7 +484,7 @@ ...@@ -484,7 +484,7 @@
<dependency> <dependency>
<groupId>org.ocpsoft.prettytime</groupId> <groupId>org.ocpsoft.prettytime</groupId>
<artifactId>prettytime</artifactId> <artifactId>prettytime</artifactId>
<version>3.2.5.Final</version> <version>3.2.7.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
...@@ -519,12 +519,12 @@ ...@@ -519,12 +519,12 @@
<dependency> <dependency>
<groupId>org.jsoup</groupId> <groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>
<version>1.8.3</version> <version>1.9.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.opencsv</groupId> <groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId> <artifactId>opencsv</artifactId>
<version>3.7</version> <version>3.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.liquibase.ext</groupId> <groupId>org.liquibase.ext</groupId>
...@@ -550,7 +550,7 @@ ...@@ -550,7 +550,7 @@
<dependency> <dependency>
<groupId>com.vladsch.flexmark</groupId> <groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId> <artifactId>flexmark-all</artifactId>
<version>0.28.34</version> <version>0.28.38</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.vdurmont</groupId> <groupId>com.vdurmont</groupId>
...@@ -579,7 +579,7 @@ ...@@ -579,7 +579,7 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
<version>2.19.0</version> <version>2.19.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -591,13 +591,13 @@ ...@@ -591,13 +591,13 @@
<dependency> <dependency>
<groupId>org.springframework.restdocs</groupId> <groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId> <artifactId>spring-restdocs-mockmvc</artifactId>
<version>1.2.4.RELEASE</version> <version>1.2.5.RELEASE</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>2.0.0</version> <version>2.1.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -609,7 +609,7 @@ ...@@ -609,7 +609,7 @@
<dependency> <dependency>
<groupId>net.java.dev.jna</groupId> <groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId> <artifactId>jna</artifactId>
<version>4.5.2</version> <version>5.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.validation</groupId> <groupId>javax.validation</groupId>
...@@ -619,7 +619,7 @@ ...@@ -619,7 +619,7 @@
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId> <artifactId>javax.el-api</artifactId>
<version>3.0.0</version> <version>3.0.1-b01</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
......
...@@ -7,10 +7,13 @@ import java.sql.ResultSet; ...@@ -7,10 +7,13 @@ import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Types; import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.text.StrBuilder;
import org.genesys2.util.NumberUtils; import org.genesys2.util.NumberUtils;
import com.opencsv.ResultSetHelperService; import com.opencsv.ResultSetHelperService;
...@@ -88,58 +91,78 @@ public class CSVResultSetHelper extends ResultSetHelperService { ...@@ -88,58 +91,78 @@ public class CSVResultSetHelper extends ResultSetHelperService {
return sb.toString(); return sb.toString();
} }
private String getColumnValue(ResultSet rs, int colType, int colIndex, boolean trim, String dateFormatString, String timestampFormatString) private String getColumnValue(ResultSet rs, int colType, int colIndex, boolean trim, String dateFormatString, String timestampFormatString) throws SQLException, IOException {
throws SQLException, IOException {
String value = ""; String value = "";
switch (colType) { switch (colType) {
case Types.BIT: case Types.BIT:
case Types.JAVA_OBJECT: case Types.JAVA_OBJECT:
value = handleObject(rs.getObject(colIndex)); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getObject(colIndex), "");
value = ObjectUtils.toString(rs.getObject(colIndex), "");
break; break;
case Types.BOOLEAN: case Types.BOOLEAN:
boolean b = rs.getBoolean(colIndex); // Once Java 7 is the minimum supported version.
value = Boolean.valueOf(b).toString(); // value = Objects.toString(rs.getBoolean(colIndex));
value = ObjectUtils.toString(rs.getBoolean(colIndex));
break; break;
case NCLOB: // todo : use rs.getNClob case Types.NCLOB: // todo : use rs.getNClob
case Types.CLOB: case Types.CLOB:
Clob c = rs.getClob(colIndex); Clob c = rs.getClob(colIndex);
if (c != null) { if (c != null) {
value = read(c); StrBuilder sb = new StrBuilder();
sb.readFrom(c.getCharacterStream());
value = sb.toString();
} }
break; break;
case Types.BIGINT: case Types.BIGINT:
value = handleLong(rs, colIndex); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getLong(colIndex));
value = ObjectUtils.toString(rs.getLong(colIndex));
break; break;
case Types.DECIMAL: case Types.DECIMAL:
case Types.REAL: case Types.REAL:
case Types.NUMERIC: case Types.NUMERIC:
value = handleBigDecimal(rs.getBigDecimal(colIndex)); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getBigDecimal(colIndex), "");
value = ObjectUtils.toString(rs.getBigDecimal(colIndex), "");
break; break;
case Types.DOUBLE: case Types.DOUBLE:
value = handleDouble(rs.getDouble(colIndex)); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getDouble(colIndex));
value = ObjectUtils.toString(rs.getDouble(colIndex));
break; break;
case Types.FLOAT: case Types.FLOAT:
value = handleFloat(rs.getFloat(colIndex)); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getFloat(colIndex));
value = ObjectUtils.toString(rs.getFloat(colIndex));
break; break;
case Types.INTEGER: case Types.INTEGER:
case Types.TINYINT: case Types.TINYINT:
case Types.SMALLINT: case Types.SMALLINT:
value = handleInteger(rs, colIndex); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getInt(colIndex));
value = ObjectUtils.toString(rs.getInt(colIndex));
break; break;
case Types.DATE: case Types.DATE:
value = handleDate(rs, colIndex, dateFormatString); java.sql.Date date = rs.getDate(colIndex);
if (date != null) {
SimpleDateFormat df = new SimpleDateFormat(dateFormatString);
value = df.format(date);
}
break; break;
case Types.TIME: case Types.TIME:
value = handleTime(rs.getTime(colIndex)); // Once Java 7 is the minimum supported version.
// value = Objects.toString(rs.getTime(colIndex), "");
value = ObjectUtils.toString(rs.getTime(colIndex), "");
break; break;
case Types.TIMESTAMP: case Types.TIMESTAMP:
value = handleTimestamp(rs.getTimestamp(colIndex), timestampFormatString); value = handleTimestamp(rs.getTimestamp(colIndex), timestampFormatString);
break; break;
case NVARCHAR: // todo : use rs.getNString case Types.NVARCHAR: // todo : use rs.getNString
case NCHAR: // todo : use rs.getNString case Types.NCHAR: // todo : use rs.getNString
case LONGNVARCHAR: // todo : use rs.getNString case Types.LONGNVARCHAR: // todo : use rs.getNString
case Types.LONGVARCHAR: case Types.LONGVARCHAR:
case Types.VARCHAR: case Types.VARCHAR:
case Types.CHAR: case Types.CHAR:
...@@ -150,14 +173,11 @@ public class CSVResultSetHelper extends ResultSetHelperService { ...@@ -150,14 +173,11 @@ public class CSVResultSetHelper extends ResultSetHelperService {
value = columnValue; value = columnValue;
} }
break; break;
case Types.BINARY:
value = handleBinary(rs, colIndex);
break;
default: default:
value = ""; value = "";
} }
if (value == null) { if (rs.wasNull() || value == null) {
value = ""; value = "";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment