diff --git a/htroot/robots.java b/htroot/robots.java index aaa3ee09b..d18723345 100644 --- a/htroot/robots.java +++ b/htroot/robots.java @@ -6,6 +6,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.List; import net.yacy.cora.protocol.RequestHeader; import net.yacy.search.Switchboard; @@ -36,7 +37,7 @@ public class robots { if (rbc.isProfileDisallowed()) prop.put(RobotsTxtConfig.ALL + "_" + RobotsTxtConfig.PROFILE, "1"); if (rbc.isLockedDisallowed() || rbc.isDirsDisallowed()) { - final ArrayList[] p = getFiles(env.getConfig(SwitchboardConstants.HTROOT_PATH, SwitchboardConstants.HTROOT_PATH_DEFAULT)); + final List[] p = getFiles(env.getConfig(SwitchboardConstants.HTROOT_PATH, SwitchboardConstants.HTROOT_PATH_DEFAULT)); if (rbc.isLockedDisallowed()) { prop.put(RobotsTxtConfig.ALL + "_" + RobotsTxtConfig.LOCKED, p[0].size()); for (int i=0; i[] getFiles(final String htrootPath) { + private static List[] getFiles(final String htrootPath) { final File htroot = new File(htrootPath); if (!htroot.exists()) return null; - final ArrayList htrootFiles = new ArrayList(); - final ArrayList htrootDirs = new ArrayList(); + final List htrootFiles = new ArrayList(); + final List htrootDirs = new ArrayList(); final String[] htroots = htroot.list(); File file; - for (int i=0, dot; i[]) new Object[] { htrootFiles, htrootDirs }; + return (List[]) new Object[] { htrootFiles, htrootDirs }; } }