Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

various bug-fixes

orbiterdc474aa22fcb
diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java
index eee824c51..f2bbbb02d 100644
--- a/htroot/SettingsAck_p.java
+++ b/htroot/SettingsAck_p.java
@@ -386,7 +386,7 @@ public class SettingsAck_p {
} else {
prop.put("info",14);
prop.put("info_errormsg",error.replaceAll("\n","<br>"));
- env.setConfig("seedUploadMethod","none");
+ //env.setConfig("seedUploadMethod","none");
}
return prop;
}
diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java
index bdcc8ce96..4f2d3ac46 100644
--- a/htroot/Settings_p.java
+++ b/htroot/Settings_p.java
@@ -49,6 +49,7 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import java.io.File;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
@@ -177,7 +178,7 @@ public final class Settings_p {
String uploaderName = (String) uploaderKeys.nextElement();
prop.put("seedUploadMethods_" +count+ "_name", uploaderName);
prop.put("seedUploadMethods_" +count+ "_selected", uploaderName.equals(enabledUploader)?1:0);
- prop.put("seedUploadMethods_" +count+ "_file", "yacy/seedUpload/yacySeedUpload" + uploaderName + ".html");
+ prop.put("seedUploadMethods_" +count+ "_file", new File(env.getRootPath(), "htroot/yacy/seedUpload/yacySeedUpload" + uploaderName + ".html").toString());
yacySeedUploader theUploader = yacyCore.getSeedUploader(uploaderName);
String[] configOptions = theUploader.getConfigurationOptions();
diff --git a/htroot/Status.java b/htroot/Status.java
index a0a8a18d1..92754534c 100644
--- a/htroot/Status.java
+++ b/htroot/Status.java
@@ -48,6 +48,8 @@
import java.lang.Math;
import java.text.DecimalFormat;
+import java.io.File;
+
import de.anomic.http.httpHeader;
import de.anomic.http.httpdByteCountInputStream;
import de.anomic.http.httpdByteCountOutputStream;
@@ -76,7 +78,7 @@ public class Status {
yacyCore.peerActions.updateMySeed();
if (((plasmaSwitchboard) env).adminAuthenticated(header) >= 2) {
- prop.put("privateStatusTable","Status_p.inc");
+ prop.put("privateStatusTable", new File(env.getRootPath(), "htroot/Status_p.inc").toString());
} else {
prop.put("privateStatusTable", "");
}
diff --git a/source/de/anomic/data/robotsParser.java b/source/de/anomic/data/robotsParser.java
index d238502b9..4a46450af 100644
--- a/source/de/anomic/data/robotsParser.java
+++ b/source/de/anomic/data/robotsParser.java
@@ -155,7 +155,7 @@ public final class robotsParser{
plasmaCrawlRobotsTxt.Entry robotsTxt4Host = plasmaSwitchboard.robots.getEntry(urlHostPort);
// if we have not found any data or the data is older than 7 days, we need to load it from the remote server
- if ((robotsTxt4Host == null) ||
+ if ((robotsTxt4Host == null) || (robotsTxt4Host.getLoadedDate() == null) ||
(System.currentTimeMillis() - robotsTxt4Host.getLoadedDate().getTime() > 7*24*60*60*1000)) {
URL robotsURL = null;
// generating the proper url to download the robots txt
diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.java
index c05c500da..b07c6dd33 100644
--- a/source/de/anomic/http/httpTemplate.java
+++ b/source/de/anomic/http/httpTemplate.java
@@ -364,7 +364,7 @@ public final class httpTemplate {
}else if( (bb & 0xFF) == ps){ //include
String include = "";
String line = "";
- keyStream = new ByteArrayOutputStream(); //reset stream
+ keyStream = new ByteArrayOutputStream(); //reset stream
if(transferUntil(pis, keyStream, iClose)){
String filename = keyStream.toString();
if(filename.startsWith( Character.toString((char)lbr) ) && filename.endsWith( Character.toString((char)rbr) )){ //simple pattern for filename
@@ -373,7 +373,7 @@ public final class httpTemplate {
if ((!filename.equals("")) && (!filename.equals(dflt))) {
BufferedReader br = null;
try{
- br = new BufferedReader(new InputStreamReader(new FileInputStream( new File("htroot", filename) )));
+ br = new BufferedReader(new InputStreamReader(new FileInputStream( filename )));
//Read the Include
while( (line = br.readLine()) != null ){
include+=line+de.anomic.server.serverCore.crlfString;
diff --git a/source/de/anomic/net/ftpc.java b/source/de/anomic/net/ftpc.java
index a48e0c044..324271a6d 100644
--- a/source/de/anomic/net/ftpc.java
+++ b/source/de/anomic/net/ftpc.java
@@ -534,7 +534,7 @@ public class ftpc {
err.println(logPrefix + "---- Syntax: GET <remote-file> [<local-file>]");
return true;
}
- String remote = (new File(cmd[1])).getName();
+ String remote = cmd[1]; //(new File(cmd[1])).getName();
File local;
File l;
if (cmd.length == 2) {
@@ -1664,15 +1664,15 @@ cd ..
}
// after stream is empty we should get control completion echo
- reply = receive();
- boolean success = (Integer.parseInt(reply.substring(0, 1)) == 2);
+ //reply = receive();
+ //boolean success = (Integer.parseInt(reply.substring(0, 1)) == 2);
// shutdown connection
outFile.close();
ClientStream.close();
data.close();
- if (!success) throw new IOException(reply);
+ //if (!success) throw new IOException(reply);
// write statistics
long stop = GregorianCalendar.getInstance(GMTTimeZone).getTime().getTime();
@@ -1910,11 +1910,12 @@ cd ..
String account, String password) {
try {
ftpc c = new ftpc();
+ if (remoteFile.length() == 0) remoteFile = "/";
c.exec("open " + host, false);
c.exec("user " + account + " " + password, false);
- c.exec("lcd " + localPath.toString(), false);
+ c.exec("lcd " + localPath.getAbsolutePath().toString(), false);
c.exec("binary", false);
- c.exec("get " + remoteFile, false);
+ c.exec("get " + remoteFile + " " + localPath.getAbsoluteFile().toString(), false);
c.exec("close", false);
c.exec("exit", false);
} catch (java.security.AccessControlException e) {