From 3c1d968d2985a4d6caee473404ef87e181d349c8 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 26 Sep 2005 10:36:42 +0000 Subject: [PATCH] fix-fix for 792 and small changes in ftpc/download/dir experiments git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@797 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/SettingsAck_p.java | 2 +- source/de/anomic/net/ftpc.java | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index f2bbbb02d..eee824c51 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","
")); - //env.setConfig("seedUploadMethod","none"); + env.setConfig("seedUploadMethod","none"); } return prop; } diff --git a/source/de/anomic/net/ftpc.java b/source/de/anomic/net/ftpc.java index 324271a6d..dae3a0182 100644 --- a/source/de/anomic/net/ftpc.java +++ b/source/de/anomic/net/ftpc.java @@ -1044,15 +1044,15 @@ cd .. if (!line.startsWith("total ")) files.addElement(line); // after stream is empty we should get control completion echo - reply = receive(); + //reply = receive(); - boolean success = (Integer.parseInt(reply.substring(0, 1)) == 2); + //boolean success = (Integer.parseInt(reply.substring(0, 1)) == 2); // shutdown connection ClientStream.close(); data.close(); - if (!success) throw new IOException(reply); + //if (!success) throw new IOException(reply); files.trimToSize(); return files; @@ -1843,6 +1843,26 @@ cd .. public void checkSecurityAccess(String provider) { } } + + public static Vector dir(String host, + String remotePath, + String account, String password, + boolean extended) { + try { + ftpc c = new ftpc(); + c.cmd = new String[]{"open", host}; c.OPEN(); + c.cmd = new String[]{"user", account, password}; c.USER(); + c.cmd = new String[]{"ls"}; Vector v = c.list(remotePath, extended); + c.cmd = new String[]{"close"}; c.CLOSE(); + c.cmd = new String[]{"exit"}; c.EXIT(); + return v; + } catch (java.security.AccessControlException e) { + return null; + } catch (IOException e) { + return null; + } + } + public static void dir(String host, String remotePath, String account, String password) {