From ca93835713b9070866b61b17ecb07175c4b99a8a Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 10 Jun 2012 23:17:21 +0200 Subject: [PATCH] removed usage of deprecated methods --- source/de/anomic/http/server/HTTPDFileHandler.java | 6 +++--- source/net/yacy/interaction/TripleStore.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.java index b643fc81f..c889b483d 100644 --- a/source/de/anomic/http/server/HTTPDFileHandler.java +++ b/source/de/anomic/http/server/HTTPDFileHandler.java @@ -1427,11 +1427,11 @@ public final class HTTPDFileHandler { final String strARGS = (String) conProp.get("ARGS"); if(strARGS.startsWith("url=")) { final String strUrl = strARGS.substring(4); // strip url= - + try { proxyurl = new URL(strUrl); } catch (MalformedURLException e) { - proxyurl = new URL (URLDecoder.decode(strUrl)); + proxyurl = new URL (URLDecoder.decode(strUrl, UTF8.charset.name())); } } @@ -1486,7 +1486,7 @@ public final class HTTPDFileHandler { String directory = ""; if (proxyurl.getPath().lastIndexOf('/') > 0) directory = proxyurl.getPath().substring(0, proxyurl.getPath().lastIndexOf('/')); - + String location = ""; if (outgoingHeader.containsKey("Location")) { diff --git a/source/net/yacy/interaction/TripleStore.java b/source/net/yacy/interaction/TripleStore.java index b2791e774..f56d1845f 100644 --- a/source/net/yacy/interaction/TripleStore.java +++ b/source/net/yacy/interaction/TripleStore.java @@ -2,15 +2,16 @@ package net.yacy.interaction; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.StringBufferInputStream; import java.util.Iterator; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; +import net.yacy.cora.document.UTF8; import net.yacy.kelondro.logging.Log; import net.yacy.search.Switchboard; @@ -32,7 +33,7 @@ public class TripleStore { if (filename.endsWith(".nt")) LoadNTriples(filename); else LoadRDF(filename); } - + public static void LoadRDF(String fileNameOrUri) throws IOException { Model tmp = ModelFactory.createDefaultModel(); Log.logInfo("TRIPLESTORE", "Loading from " + fileNameOrUri); @@ -67,8 +68,7 @@ public class TripleStore { try { - @SuppressWarnings("deprecation") - InputStream in = new StringBufferInputStream(rdffile); + InputStream in = new ByteArrayInputStream(UTF8.getBytes(rdffile)); // read the RDF/XML file tmp.read(in, null);