I am using FTP (com.jscape.inet.ftp.Ftp) in my java code to get file listing. I am using the following piece of code to get list of files.
Enumeration<String> files= ftp.getNameListing("test*");
The above code lists all the files with test* name.
However, I am facing issue while listing all the test files ending with A or B. I tried the below pattern to get the listing.
Enumeration<String> files= ftp.getNameListing("test*[A-B]");
Enumeration<String> files= ftp.getNameListing("test*[AB]");
However none of them are working and I am receiving an exception
501 Qualifier too long. Use MVS naming conventions.
com.jscape.inet.ftp.FtpException: Unable to connect to host **.**.**.**
at com.jscape.inet.ftp.FtpBaseImplementation.openDataConnection(Unknown Source)
at com.jscape.inet.ftp.FtpBaseImplementation.getNameListing(Unknown Source)
at com.jscape.inet.ftp.Ftp.getNameListing(Unknown Source)
Any help is appreciated.