removed usage of deprecated methods

pull/1/head
Michael Peter Christen 13 years ago
parent 23e38bd918
commit ca93835713

@ -1427,11 +1427,11 @@ public final class HTTPDFileHandler {
final String strARGS = (String) conProp.get("ARGS"); final String strARGS = (String) conProp.get("ARGS");
if(strARGS.startsWith("url=")) { if(strARGS.startsWith("url=")) {
final String strUrl = strARGS.substring(4); // strip url= final String strUrl = strARGS.substring(4); // strip url=
try { try {
proxyurl = new URL(strUrl); proxyurl = new URL(strUrl);
} catch (MalformedURLException e) { } 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 = ""; String directory = "";
if (proxyurl.getPath().lastIndexOf('/') > 0) if (proxyurl.getPath().lastIndexOf('/') > 0)
directory = proxyurl.getPath().substring(0, proxyurl.getPath().lastIndexOf('/')); directory = proxyurl.getPath().substring(0, proxyurl.getPath().lastIndexOf('/'));
String location = ""; String location = "";
if (outgoingHeader.containsKey("Location")) { if (outgoingHeader.containsKey("Location")) {

@ -2,15 +2,16 @@
package net.yacy.interaction; package net.yacy.interaction;
import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.StringBufferInputStream;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.document.UTF8;
import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
@ -32,7 +33,7 @@ public class TripleStore {
if (filename.endsWith(".nt")) LoadNTriples(filename); if (filename.endsWith(".nt")) LoadNTriples(filename);
else LoadRDF(filename); else LoadRDF(filename);
} }
public static void LoadRDF(String fileNameOrUri) throws IOException { public static void LoadRDF(String fileNameOrUri) throws IOException {
Model tmp = ModelFactory.createDefaultModel(); Model tmp = ModelFactory.createDefaultModel();
Log.logInfo("TRIPLESTORE", "Loading from " + fileNameOrUri); Log.logInfo("TRIPLESTORE", "Loading from " + fileNameOrUri);
@ -67,8 +68,7 @@ public class TripleStore {
try { try {
@SuppressWarnings("deprecation") InputStream in = new ByteArrayInputStream(UTF8.getBytes(rdffile));
InputStream in = new StringBufferInputStream(rdffile);
// read the RDF/XML file // read the RDF/XML file
tmp.read(in, null); tmp.read(in, null);

Loading…
Cancel
Save