Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.4k views
in Java FTP by (160 points)
Hi,
In the
FTPClient.quote(java.lang.String command,                              java.lang.String[] validCodes)
method, I can't figure out what values I am supposed to give to
validCodes

I use this method to execute the following command :

site mapin text (filekind=data, rec=550)

and I get the following error :
FTPException MAPIn Local SITE Command syntax error: The file transfer type is not compatible with the mapping style
com.enterprisedt.net.ftp.FTPException: MAPIn Local SITE Command syntax error: The file transfer type is not compatible with the mapping style
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:668)
at com.enterprisedt.net.ftp.FTPClient.quote(FTPClient.java:762)

3 Answers

0 votes
by (51.4k points)
Each time an FTP command is issued, the server's response starts with a 3 digit number (e.g. 200 meaning OK). validCodes should contain all the possible codes that indicate that the command was processed successfully. The value of validCodes is not used until after the command has been sent and the server sends its response.

The text in command is passed directly to the server without any processing. The error-message that your quote, i.e. "MAPIn Local SITE Command syntax error: The file transfer type is not compatible with the mapping style", is generated on the server. It therefore appears that there is a problem with the command itself - not with the value of validCodes.

You might like to see if you get the same result in a stand-alone FTP client such as FileZilla. In FileZilla you can enter custom commands by using the Server -> Enter raw FTP command menu option.

Good luck
- Hans (EDT Support)
0 votes
by (161k points)
Could it be that you are in binary mode and you need to be in ascii?

Hi,
In the
FTPClient.quote(java.lang.String command,                              java.lang.String[] validCodes)
method, I can't figure out what values I am supposed to give to
validCodes

I use this method to execute the following command :

site mapin text (filekind=data, rec=550)

and I get the following error :
FTPException MAPIn Local SITE Command syntax error: The file transfer type is not compatible with the mapping style
com.enterprisedt.net.ftp.FTPException: MAPIn Local SITE Command syntax error: The file transfer type is not compatible with the mapping style
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:668)
at com.enterprisedt.net.ftp.FTPClient.quote(FTPClient.java:762)
0 votes
by (160 points)
thanks guys. Actually, I changed
binary
into
ascii
and it now works correctly.
Btw, I also tried my command in FileZilla but I get another error type. But as it works the way I intended to use it in Java, I am satisfied.
Thanks again for your help

Categories

...