I need to read CSV file header from FTP.
As these files can be very huge, I don’t need to download them.
Is there a way to read first line of CSV file from FTP and abort connection?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just read only the first line, ignore the remnant and close the stream. A smart FTP client won’t buffer the entire stream in memory before providing anything for read.
Assuming you’re using Apache Commons Net FTPClient: