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
pull/1/head
orbiter 20 years ago
parent b5a8992d29
commit 3c1d968d29

@ -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;
}

@ -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) {

Loading…
Cancel
Save