Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-2173 - Fix String.join issue in FileDumper

Michael James Joyceb511a22a1c20
diff --git a/CHANGES.txt b/CHANGES.txt
index 21c87ee38..520f1023e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,8 @@ Nutch Change Log
Nutch 1.11 Release 25/10/2015 (dd/mm/yyyy)
Release Report: http://s.apache.org/nutch11
+* NUTCH-2173 String.join in FileDumper breaks the build (joyce)
+
* NUTCH-2166 Add reverse URL format to dump tool (joyce)
* NUTCH-2157 Addressing Miredot REST API Warnings (Sujen Shah)
diff --git a/src/java/org/apache/nutch/tools/FileDumper.java b/src/java/org/apache/nutch/tools/FileDumper.java
index 3a50a8771..8d30c33f2 100644
--- a/src/java/org/apache/nutch/tools/FileDumper.java
+++ b/src/java/org/apache/nutch/tools/FileDumper.java
@@ -256,12 +256,12 @@ public class FileDumper {
reversedURL[reversedURL.length - 1] += "_file";
}
- String reversedURLPath = String.join("/", reversedURL);
+ String reversedURLPath = org.apache.commons.lang3.StringUtils.join(reversedURL, "/");
outputFullPath = String.format("%s/%s", fullDir, reversedURLPath);
// We'll drop the trailing file name and create the nested structure if it doesn't already exist.
String[] splitPath = outputFullPath.split("/");
- File fullOutputDir = new File(String.join("/", Arrays.asList(splitPath).subList(0, splitPath.length - 1)));
+ File fullOutputDir = new File(org.apache.commons.lang3.StringUtils.join(Arrays.copyOf(splitPath, splitPath.length - 1), "/"));
if (!fullOutputDir.exists()) {
fullOutputDir.mkdirs();