Skip to content

Commit

Permalink
Restore commons.fileupload (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-mcgoldrick authored Jan 24, 2025
1 parent bdd5a43 commit 8322158
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 deletions.
7 changes: 4 additions & 3 deletions agent/agent_common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@


<dependencies>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
</dependency>

<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import java.util.Map;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.fileupload.MultipartStream;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.intuit.tank.http.binary.BinaryResponse;
import com.intuit.tank.http.json.JsonResponse;
import com.intuit.tank.http.xml.XMLResponse;
import org.apache.tomcat.util.http.fileupload.MultipartStream;

import static java.util.stream.Collectors.joining;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.zip.GZIPInputStream;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.URIBuilder;
import org.apache.logging.log4j.LogManager;
Expand All @@ -15,7 +16,6 @@
import com.intuit.tank.vm.settings.CloudCredentials;
import com.intuit.tank.vm.settings.CloudProvider;
import com.intuit.tank.vm.settings.TankConfig;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
Expand Down
27 changes: 5 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,28 +306,6 @@
<artifactId>weld-servlet-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>


Expand Down Expand Up @@ -543,6 +521,11 @@
<artifactId>json-rpc</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions rest-mvc/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<artifactId>tank-script-processor</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import com.intuit.tank.script.models.*;
import com.intuit.tank.script.RequestDataPhase;

import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

Expand Down Expand Up @@ -329,7 +329,7 @@ public static ScriptTO parseXMLtoScriptTO(InputStream inputStream) {
JAXBContext ctx = JAXBContext.newInstance(ScriptTO.class.getPackage().getName());
return (ScriptTO) ctx.createUnmarshaller().unmarshal(xmlSource);
} catch (ParserConfigurationException | JAXBException | SAXException e) {
LOG.error("Error unmarshalling script: " + e.getMessage() , e);
LOG.error("Error unmarshalling script: {}", e.getMessage(), e);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
} finally {
IOUtils.closeQuietly(inputStream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import com.intuit.tank.project.Script;
import com.intuit.tank.project.ScriptStep;
import com.intuit.tank.script.RequestDataPhase;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

Expand All @@ -43,7 +43,6 @@
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -366,7 +365,7 @@ public static ScriptTO parseXMLtoScriptTO(InputStream inputStream) {
JAXBContext ctx = JAXBContext.newInstance(ScriptTO.class.getPackage().getName());
return (ScriptTO) ctx.createUnmarshaller().unmarshal(xmlSource);
} catch (ParserConfigurationException | JAXBException | SAXException e) {
LOG.error("Error unmarshalling script: " + e.getMessage() , e);
LOG.error("Error unmarshalling script: {}", e.getMessage(), e);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
} finally {
IOUtils.closeQuietly(inputStream);
Expand Down
21 changes: 20 additions & 1 deletion web/web_support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,26 @@
<scope>runtime</scope>
</dependency>


<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<scope>provided</scope>
</dependency>

</dependencies>
</project>

0 comments on commit 8322158

Please sign in to comment.