Commit a0ec16fc authored by Grégory Mantelet's avatar Grégory Mantelet
Browse files

[UWS,TAP] Replacement of com.oreilly.servlet by Apache Commons File Upload.

Thus, the UPLOAD management is much more stable and relies on a well documented
and maintained library (but at the cost of the additionnal size of the final
JAR). The most important point is the capability to efficiently limit the size
of the incoming file and on the disk/memory management when uploading the
file(s) and in case of error during this process (i.e. files must be deleted).
parent 508ad764
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -8,17 +8,18 @@ repositories {
}

dependencies {
    compile fileTree(dir: 'lib', includes: ['stil_3.1.jar','cos-1.5beta.jar'])
    compile fileTree(dir: 'lib', includes: ['stil_3.1.jar'])
    compile 'javax.servlet:javax.servlet-api:3.0.1'
    compile 'postgresql:postgresql:9.1-901.jdbc4'
    compile 'org.slf4j:slf4j-api:1.7.25'
    compile 'commons-io:commons-io:2.6'
    compile 'commons-fileupload:commons-fileupload:1.3.3'

    testCompile 'junit:junit:4.12'
    testCompile 'com.h2database:h2:1.4.193'
    testCompile fileTree(dir: 'lib', include: 'astroh2-0.3.jar')
    testCompile 'org.slf4j:slf4j-simple:1.7.25'
    
    
    testRuntime 'simple-jndi:simple-jndi:0.11.4.1'
    testRuntime 'com.vividsolutions:jts-core:1.14.0'
    testRuntime 'org.locationtech.spatial4j:spatial4j:0.6'
+14 −7
Original line number Diff line number Diff line
@@ -12,8 +12,10 @@
	<property name="classesDir" value="${compileDir}"/>
	<property name="javadocDir" value="javadoc/tap" />

	<property name="cosJarName" value="cos-1.5beta.jar" />
	<property name="cosJar" value="${libDir}/${cosJarName}" />
	<property name="commonsIOJarName" value="commons-io-2.6.jar" />
	<property name="commonsIOJar" value="${libDir}/${commonsIOJarName}" />
	<property name="commonsFileUploadJarName" value="commons-fileupload-1.3.3.jar" />
	<property name="commonsFileUploadJar" value="${libDir}/${commonsFileUploadJarName}" />
	
	<property name="stilJarName" value="stil_3.1.jar" />
	<property name="stilJar" value="${libDir}/${stilJarName}" />
@@ -70,7 +72,8 @@

	<!-- CLASSPATHS -->
	<path id="tap.classpath">
		<pathelement location="${cosJar}" />
		<pathelement location="${commonsIOJar}" />
		<pathelement location="${commonsFileUploadJar}" />
		<pathelement location="${slf4jApiJar}" />
		<pathelement location="${jsonJar}" />
		<pathelement location="${stilJar}" />
@@ -168,12 +171,14 @@
	<target name="buildLib" depends="compileLib,junitValidation" description="After 'clean', build the library JAR (only classes).">
		<echo>Generate the library:</echo>
		<jar basedir="${classesDir}" destfile="${libJarFileWithSTIL}" includes="${includesList}">
			<zipfileset src="${cosJar}" excludes="META-INF/*" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset src="${stilJar}" excludes="META-INF/*" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
		</jar>
		<jar basedir="${classesDir}" destfile="${libJarFile}" includes="${includesList}">
			<zipfileset src="${cosJar}" excludes="META-INF/*" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
		</jar>
		<delete dir="${compileDir}" failonerror="true" />
@@ -182,12 +187,14 @@
	<target name="buildLibAndSrc" depends="buildLib" description="After 'clean' and 'buildLib', build the sources JAR (only .java).">
		<jar compress="false" destfile="${srcJarFileWithSTIL}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${cosJarName}" fullPath="${cosJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
			<zipfileset dir="${libDir}" includes="${stilJarName}" fullPath="${stilJar}" />
		</jar>
		<jar compress="false" destfile="${srcJarFile}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${cosJarName}" fullPath="${cosJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
		</jar>
	</target>
	
+10 −5
Original line number Diff line number Diff line
@@ -12,8 +12,10 @@
	<property name="classesDir" value="${compileDir}"/>
	<property name="javadocDir" value="javadoc/uws" />

	<property name="cosJarName" value="cos-1.5beta.jar" />
	<property name="cosJar" value="${libDir}/${cosJarName}" />
	<property name="commonsIOJarName" value="commons-io-2.6.jar" />
	<property name="commonsIOJar" value="${libDir}/${commonsIOJarName}" />
	<property name="commonsFileUploadJarName" value="commons-fileupload-1.3.3.jar" />
	<property name="commonsFileUploadJar" value="${libDir}/${commonsFileUploadJarName}" />

	<property name="slf4jApiJarName" value="slf4j-api-1.7.25.jar" />
	<property name="slf4jApiJar" value="${libDir}/${slf4jApiJarName}" />
@@ -38,7 +40,8 @@

	<!-- CLASSPATHS -->
	<path id="uws.classpath">
		<pathelement location="${cosJar}" />
		<pathelement location="${commonsIOJar}" />
		<pathelement location="${commonsFileUploadJar}" />
		<pathelement location="${slf4jApiJar}" />
		<pathelement location="${SERVLET-API}" />
	</path>
@@ -110,7 +113,8 @@
	<target name="buildLib" depends="compileLib,junitValidation" description="After 'clean', build the library JAR (only classes).">
		<echo>Generate the library:</echo>
		<jar basedir="${classesDir}" destfile="${libJarFile}" includes="${includesList}">
			<zipfileset src="${cosJar}" excludes="META-INF/*" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
		</jar>
		<delete dir="${compileDir}" failonerror="true" />
@@ -119,7 +123,8 @@
	<target name="buildLibAndSrc" depends="buildLib" description="After 'clean' and 'buildLib', build the sources JAR (only .java).">
		<jar compress="false" destfile="${srcJarFile}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${cosJarName}" fullPath="${cosJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
		</jar>
	</target>
	
+68.9 KiB

File added.

No diff preview for this file type.

lib/commons-io-2.6.jar

0 → 100644
+210 KiB

File added.

No diff preview for this file type.

Loading