Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'maven-publish'
}

import org.labkey.gradle.task.RunTestSuite

import org.labkey.gradle.task.RunUiTest
import org.labkey.gradle.util.BuildUtils
import org.labkey.gradle.util.GroupNames
Expand All @@ -25,20 +25,18 @@ project.dependencies {
api("org.seleniumhq.selenium:selenium-api:${seleniumVersion}")
api("org.assertj:assertj-core:${assertjVersion}")
implementation("org.awaitility:awaitility:${awaitilityVersion}")
implementation("commons-io:commons-io:${commonsIoVersion}")
implementation("commons-io:commons-io:${commonsIoVersion}") // Dependency of poi, tika, and commons-compress
implementation("com.fasterxml.jackson.core:jackson-annotations:${jacksonAnnotationsVersion}")
implementation("org.bouncycastle:bcprov-jdk18on:${bouncycastleVersion}")
implementation("org.apache.commons:commons-csv:${apacheCommonsCsvVersion}")

//api "org.seleniumhq.selenium:selenium-server:${seleniumVersion}"
implementation("org.seleniumhq.selenium:selenium-firefox-driver:${seleniumVersion}")
api("org.seleniumhq.selenium:selenium-support:${seleniumVersion}")
implementation("org.seleniumhq.selenium:selenium-remote-driver:${seleniumVersion}")
implementation("org.seleniumhq.selenium:selenium-chrome-driver:${seleniumVersion}")
implementation "org.seleniumhq.selenium:selenium-ie-driver:${seleniumVersion}"
implementation("org.eclipse.jetty:jetty-util:${jettyVersion}")

implementation("com.google.guava:guava:${guavaVersion}")
implementation("com.google.guava:guava:${guavaVersion}") // Dependency of mockserver
api("org.apache.httpcomponents.core5:httpcore5:${httpcore5Version}")
api("org.apache.httpcomponents.client5:httpclient5:${httpclient5Version}")
api("org.hamcrest:hamcrest:${hamcrestVersion}")
Expand All @@ -50,8 +48,7 @@ project.dependencies {
implementation "org.apache.logging.log4j:log4j-core:${log4j2Version}"
implementation "org.apache.logging.log4j:log4j-iostreams:${log4j2Version}"
api "com.github.lookfirst:sardine:${project.lookfirstSardineVersion}"
implementation "javax.xml.bind:jaxb-api:${jaxbApiOldVersion}"
implementation "org.glassfish.jaxb:jaxb-runtime:${jaxbOldVersion}"
implementation "org.glassfish.jersey.media:jersey-media-multipart:${jerseyVersion}"
api "commons-beanutils:commons-beanutils:${commonsBeanutilsVersion}"
implementation "org.apache.tika:tika-core:${tikaVersion}"
implementation "org.apache.commons:commons-compress:${commonsCompressVersion}"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ awaitilityVersion=4.3.0

lookfirstSardineVersion=5.13

jettyVersion=12.1.10
jerseyVersion=4.0.2

seleniumVersion=4.45.0
seleniumVersion=4.46.0

mockserverNettyVersion=5.15.0
mockserverNettyVersion=7.4.0

labkeySchemasTestVersion=26.7-SNAPSHOT
20 changes: 12 additions & 8 deletions src/org/labkey/test/util/EscapeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.poi.ss.util.WorkbookUtil;
import org.eclipse.jetty.util.URIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.labkey.test.params.FieldKey;
Expand Down Expand Up @@ -153,14 +152,17 @@ public static String encode(String s)
}

/**
* Encode a string to be used as a URL path
* For now, simply designates to URIUtil. Will replace with an impl that doesn't require Jetty utils.
* Encode a string to be used as a URL path. Doesn't encode '/' because they are not allowed in any path parts such
* as project, folder, or file names.
*
* @param path Path to be encoded
* @return encoded value or empty string if provided string was `null`
* @return encoded path
*/
public static String encodeUriPath(String path)
{
return URIUtil.encodePath(path);
return URLEncoder.encode(StringUtils.trimToEmpty(path), StandardCharsets.UTF_8)
.replace("%2F", "/") // '/' is a separator, shouldn't be encoded
.replace("+", "%20"); // labKey doesn't, generally, encode space as '+'
}

/**
Expand All @@ -176,13 +178,15 @@ public static String decode(String s)

/**
* Decode a string representing a URL path
* For now, simply designates to URIUtil. Will replace with an impl that doesn't require Jetty utils.
*
* @param path path to be decoded
* @return decoded value or empty string if the provided string was `null`
* @return decoded path
*/
public static String decodeUriPath(String path)
{
return URIUtil.decodePath(path);
// Prevent '+' becoming ' '
path = StringUtils.trimToEmpty(path).replace("+", "%2B");
return URLDecoder.decode(path, StandardCharsets.UTF_8);
}

public static String fieldKeyEncodePart(String str)
Expand Down
6 changes: 3 additions & 3 deletions src/org/labkey/test/util/SimpleHttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.glassfish.jersey.media.multipart.ContentDisposition;
import org.labkey.remoteapi.Connection;
import org.labkey.test.TestFileUtils;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.WebDriver;

import javax.mail.internet.ContentDisposition;
import javax.mail.internet.ParseException;
import java.io.File;
import java.io.IOException;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.Base64;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -184,7 +184,7 @@ public File getResponseAsFile(File targetFile) throws IOException
{
try
{
responseFilename = new ContentDisposition(contentDisposition).getParameter("filename");
responseFilename = new ContentDisposition(contentDisposition).getFileName();
}
catch (ParseException ignore) { }
}
Expand Down
Loading