aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2018-04-01 12:28:28 +0200
committerMartin Stockhammer <martin_s@apache.org>2018-04-01 12:28:28 +0200
commitb3335cf6e50adeea3600e165585e146e1524ea3a (patch)
tree9174af676a73af30be57f555e0a10549c66f8249 /archiva-modules/archiva-web
parentf8a9bc1640ddbe2748eb7bc8e68b4dd3dd84fa51 (diff)
downloadarchiva-b3335cf6e50adeea3600e165585e146e1524ea3a.tar.gz
archiva-b3335cf6e50adeea3600e165585e146e1524ea3a.zip
Changes to avoid compile warnings
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java2
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java3
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java3
3 files changed, 5 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
index 3e91e48c5..b99be0395 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
@@ -56,7 +56,7 @@ public class RestDocsServlet
if ( StringUtils.endsWith( path, ".xsd" ) )
{
- StringEscapeUtils.escapeXml( resp.getWriter(), IOUtils.toString( is ) );
+ StringEscapeUtils.escapeXml( resp.getWriter(), IOUtils.toString( is, "UTF-8" ) );
//IOUtils.copy( is, resp.getOutputStream() );
return;
}
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
index f1c79ae8a..db2a713a2 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
@@ -44,6 +44,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -182,7 +183,7 @@ public class DownloadArtifactsTest
List<String> entries = getZipEntriesNames( zipFile );
ZipEntry zipEntry = zipFile.getEntry( "org/junit/runners/JUnit4.class" );
assertNotNull( "cannot find zipEntry org/junit/runners/JUnit4.class, entries: " + entries + ", content is: "
- + FileUtils.readFileToString( file.toFile() ), zipEntry );
+ + FileUtils.readFileToString( file.toFile(), Charset.forName( "UTF-8") ), zipEntry );
zipFile.close();
file.toFile().deleteOnExit();
}
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java
index 024e1b855..eeacbf989 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java
@@ -34,6 +34,7 @@ import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -126,7 +127,7 @@ public class DownloadSnapshotTest
List<String> entries = getZipEntriesNames( zipFile );
ZipEntry zipEntry = zipFile.getEntry( "org/apache/archiva/model/ArchivaArtifact.class" );
assertNotNull( "cannot find zipEntry org/apache/archiva/model/ArchivaArtifact.class, entries: " + entries + ", content is: "
- + FileUtils.readFileToString( file.toFile() ), zipEntry );
+ + FileUtils.readFileToString( file.toFile(), Charset.forName( "UTF-8") ), zipEntry );
zipFile.close();
file.toFile().deleteOnExit();