diff --git a/htroot/BlogComments.java b/htroot/BlogComments.java index 7e21a1528..51849b73f 100644 --- a/htroot/BlogComments.java +++ b/htroot/BlogComments.java @@ -48,6 +48,7 @@ import net.yacy.data.BlogBoard.BlogEntry; import net.yacy.peers.Network; import net.yacy.peers.Seed; import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; @@ -143,8 +144,8 @@ public class BlogComments { messageForwardingViaEmail(sb, msgEntry); // finally write notification - final File notifierSource = new File(sb.getAppPath(), sb.getConfig("htRootPath","htroot") + "/env/grafics/message.gif"); - final File notifierDest = new File(sb.getDataPath("htDocsPath", "DATA/HTDOCS"), "notifier.gif"); + final File notifierSource = new File(sb.getAppPath(), sb.getConfig(SwitchboardConstants.HTROOT_PATH, SwitchboardConstants.HTROOT_PATH_DEFAULT) + "/env/grafics/message.gif"); + final File notifierDest = new File(sb.getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT), "notifier.gif"); try { Files.copy(notifierSource, notifierDest); } catch (final IOException e) { diff --git a/htroot/ConfigAppearance_p.java b/htroot/ConfigAppearance_p.java index e7495bb6b..8635e90a3 100644 --- a/htroot/ConfigAppearance_p.java +++ b/htroot/ConfigAppearance_p.java @@ -162,7 +162,7 @@ public class ConfigAppearance_p { } private static boolean changeSkin(final Switchboard sb, final String skinPath, final String skin) { - final File htdocsDir = new File(sb.getDataPath("htDocsPath", "DATA/HTDOCS"), "env"); + final File htdocsDir = new File(sb.getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT), "env"); final File styleFile = new File(htdocsDir, "style.css"); final File skinFile = new File(skinPath, skin); diff --git a/htroot/Messages_p.java b/htroot/Messages_p.java index 80aeb46ef..45c59a749 100644 --- a/htroot/Messages_p.java +++ b/htroot/Messages_p.java @@ -38,6 +38,7 @@ import net.yacy.cora.protocol.RequestHeader; import net.yacy.data.MessageBoard; import net.yacy.peers.Seed; import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; @@ -96,8 +97,8 @@ public class Messages_p { MessageBoard.entry message; // first reset notification - final File notifierSource = new File(sb.getAppPath(), sb.getConfig("htRootPath", "htroot") + "/env/grafics/empty.gif"); - final File notifierDest = new File(sb.getDataPath("htDocsPath", "DATA/HTDOCS"), "notifier.gif"); + final File notifierSource = new File(sb.getAppPath(), sb.getConfig(SwitchboardConstants.HTROOT_PATH, SwitchboardConstants.HTROOT_PATH_DEFAULT) + "/env/grafics/empty.gif"); + final File notifierDest = new File(sb.getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT), "notifier.gif"); try { Files.copy(notifierSource, notifierDest); } catch (final IOException e) { diff --git a/htroot/www/welcome.java b/htroot/www/welcome.java index 86aed58b3..e131383df 100644 --- a/htroot/www/welcome.java +++ b/htroot/www/welcome.java @@ -35,6 +35,7 @@ import net.yacy.cora.protocol.HeaderFramework; import net.yacy.cora.protocol.RequestHeader; import net.yacy.peers.Seed; import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; @@ -61,8 +62,8 @@ public class welcome { final boolean senior = (peertype.equals(Seed.PEERTYPE_SENIOR)) || (peertype.equals(Seed.PEERTYPE_PRINCIPAL)); if (senior) { prop.put("couldcan", "can"); } else { prop.put("couldcan", "could"); } if (senior) { prop.put("seniorinfo", "This peer runs in senior mode which means that your peer can be accessed using the addresses shown above."); } else { prop.putHTML("seniorinfo", "Nobody can access your peer from the outside of your intranet. You must open your firewall and/or set a 'virtual server' in the settings of your router to enable access to the addresses as shown below."); } - final File wwwpath = env.getDataPath("htDocsPath", "DATA/HTDOCS"); - prop.putHTML("wwwpath", wwwpath.isAbsolute() ? wwwpath.getAbsolutePath() : "/" + env.getConfig("htDocsPath", "DATA/HTDOCS")); + final File wwwpath = env.getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT); + prop.putHTML("wwwpath", wwwpath.isAbsolute() ? wwwpath.getAbsolutePath() : "/" + env.getConfig(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT)); // return rewrite properties return prop; diff --git a/htroot/yacy/message.java b/htroot/yacy/message.java index 3544c4186..41bb6dde4 100644 --- a/htroot/yacy/message.java +++ b/htroot/yacy/message.java @@ -45,6 +45,7 @@ import net.yacy.peers.Network; import net.yacy.peers.Protocol; import net.yacy.peers.Seed; import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; import net.yacy.utils.crypt; @@ -148,8 +149,8 @@ public final class message { messageForwardingViaEmail(sb, msgEntry); // finally write notification - final File notifierSource = new File(sb.getAppPath(), sb.getConfig("htRootPath","htroot") + "/env/grafics/message.gif"); - final File notifierDest = new File(sb.getDataPath("htDocsPath", "DATA/HTDOCS"), "notifier.gif"); + final File notifierSource = new File(sb.getAppPath(), sb.getConfig(SwitchboardConstants.HTROOT_PATH,SwitchboardConstants.HTROOT_PATH_DEFAULT) + "/env/grafics/message.gif"); + final File notifierDest = new File(sb.getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT), "notifier.gif"); try { Files.copy(notifierSource, notifierDest); } catch (final IOException e) { diff --git a/source/net/yacy/http/servlets/YaCyDefaultServlet.java b/source/net/yacy/http/servlets/YaCyDefaultServlet.java index 6ad91b7a1..dd8098a5b 100644 --- a/source/net/yacy/http/servlets/YaCyDefaultServlet.java +++ b/source/net/yacy/http/servlets/YaCyDefaultServlet.java @@ -356,7 +356,7 @@ public class YaCyDefaultServlet extends HttpServlet { } } finally { if (resource != null) { - resource.release(); + resource.close(); } } }