From 4e201bad21e033cdf0d52d52ab41fa77bf9f6424 Mon Sep 17 00:00:00 2001 From: Ahmet Arslan Date: Thu, 16 Oct 2014 13:42:25 +0300 Subject: [PATCH] Update ClueWeb09WarcRecord.java relying on default locale is not good --- src/main/java/org/clueweb/clueweb09/ClueWeb09WarcRecord.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/clueweb/clueweb09/ClueWeb09WarcRecord.java b/src/main/java/org/clueweb/clueweb09/ClueWeb09WarcRecord.java index c060e09..64d3d24 100644 --- a/src/main/java/org/clueweb/clueweb09/ClueWeb09WarcRecord.java +++ b/src/main/java/org/clueweb/clueweb09/ClueWeb09WarcRecord.java @@ -58,6 +58,7 @@ import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.Iterator; +import java.util.Locale; import java.util.Map.Entry; import java.util.Set; @@ -210,7 +211,7 @@ private static byte[] readNextRecord(DataInputStream in, StringBuffer headerBuff headerBuffer.append(NEWLINE); String[] thisHeaderPieceParts = line.split(":", 2); if (thisHeaderPieceParts.length == 2) { - if (thisHeaderPieceParts[0].toLowerCase().startsWith("content-length")) { + if (thisHeaderPieceParts[0].toLowerCase(Locale.US).startsWith("content-length")) { foundContentLength = true; try { contentLength = Integer.parseInt(thisHeaderPieceParts[1].trim()); @@ -494,7 +495,7 @@ public void setWarcDate(String dateString) { * Sets the WARC uuid string * * @param UUID - */ + */l public void setWarcUUID(String UUID) { warcHeader.UUID = UUID; }