I am working on a download manager, that will support http/https/ftp protocols. I am using FTPClient from the Apache commons library to download files via FTP. I want to be able to determine the MIME-Type of the file that is about to be downloaded. Please note that I know how to use the retrieveFile method from FTPClient. I just want to get MIME-Type of file like audio/wma.
Could any one please guide me to get this ?
Thanks in advance
Well, you won’t be able to get the MIME type of a file using FTP commands as it’s not supported, therefore
FTPClienthas no support to provide that information. However, after you’ve downloaded the file you can useorg.apache.sling.commons.mimeto get the MIME type.