Skip to content

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

fixes to ftp client

orbiter14e4fae8e996
diff --git a/source/net/yacy/cora/protocol/ftp/FTPClient.java b/source/net/yacy/cora/protocol/ftp/FTPClient.java
index 5ce8464e9..289425902 100644
--- a/source/net/yacy/cora/protocol/ftp/FTPClient.java
+++ b/source/net/yacy/cora/protocol/ftp/FTPClient.java
@@ -2218,10 +2218,6 @@ public class FTPClient {
outFile.write(block, 0, numRead);
length = length + numRead;
}
-
- // after stream is empty we should get control completion echo
- /*reply =*/ receive();
- // boolean success = !isNotPositiveCompletion(reply);
} finally {
// shutdown connection
if(outFile != null) {
@@ -2233,6 +2229,9 @@ public class FTPClient {
closeDataSocket();
}
+ // after stream is empty we should get control completion echo
+ /*reply =*/ receive();
+ // boolean success = !isNotPositiveCompletion(reply);
// if (!success) throw new IOException(reply);
// write statistics
@@ -2287,10 +2286,6 @@ public class FTPClient {
os.write(block, 0, numRead);
length = length + numRead;
}
-
- // after stream is empty we should get control completion echo
- /*reply =*/ receive();
- // boolean success = !isNotPositiveCompletion(reply);
} finally {
// shutdown connection
if (ClientStream != null) {
@@ -2298,6 +2293,10 @@ public class FTPClient {
}
closeDataSocket();
}
+
+ // after stream is empty we should get control completion echo
+ /*reply =*/ receive();
+ // boolean success = !isNotPositiveCompletion(reply);
return os.toByteArray();
} else {
throw new IOException(reply);
@@ -2342,13 +2341,13 @@ public class FTPClient {
inFile.close();
ClientStream.close();
+ // shutdown remote client connection
+ data.close();
+
// after stream is empty we should get control completion echo
reply = receive();
final boolean success = (getStatus(reply) == 2);
- // shutdown remote client connection
- data.close();
-
if (!success) {
throw new IOException(reply);
}
@@ -2536,7 +2535,7 @@ public class FTPClient {
try {
list = ftpClient.list(path, true);
} catch (IOException e) {
- e.printStackTrace();
+ //e.printStackTrace();
return;
}
if (!path.endsWith("/")) path += "/";