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