To set error text we set the map key indicated in the api docs.
If we return a false value from the method, the put response text will contain the error text as indicated.
What we need is a äóìKEY_SUCCESS_BUFFERäó to set the text when the put is successful so that we can return a reference number to the sender.
static java.lang.String KEY_ERROR_BUFFER
java.util.Map inargs, java.util.Map outargs)
This Interface method is called when SI SFTP server receives a put command and just before executing the put command. This can be used to validate input file and you can also send a negative reply by returning false. The parameter maps ("inargs" and "outargs") passed contains following keys (mentioned as parameters) Note: inargs is an unmodifiable map
logBuffer - (java.lang.StringBuffer) [outargs] append your log statements to this and you can see them in SI User Exit Logs.
errorBuffer - (java.lang.StringBuffer) [outargs] append your error message which will be used in the response to remote client (try to keep it small).
instanceName - (java.lang.String) [inargs]This is the instance name as given in the "Name" field while configuring the adapter.
clientAddress - (java.net.InetAddress) [inargs] IP Address of the remote client who connected to our server.
clientPort - (int) [inargs] Port of the remote client.
serverAddress - (java.net.InetAddress) [inargs] IP Address of the server.
serverPort - (java.net.InetAddress) [inargs] Port of the server.
userId - (java.lang.String) [inargs] userID for the session.
fileName - (java.lang.String) [inargs] name of the received document.
dirPath - (java.lang.String) [inargs] directory path where the file is present.
commandName - (java.lang.String) [inargs] Command name (SSH_FXP_WRITE/SSH_FXP_READ).
transferMode - (java.lang.String) [inargs] Transfer mode will be BINARY.
A (boolean) value must be returned, if returned false then it will cause sending a negative reply code indicating transfer failed. Also the file will be ignored and will not be added to storage.
(java.lang.Exception) - Your code may throw exceptions. In this case the default value set for returnOnException will be used to determine action.