We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description: $subject.
Steps to Reproduce
import wso2/ftp; import ballerina/config; import ballerina/http; import ballerina/log; ftp:ClientEndpointConfig ftpConfig = { protocol: ftp:FTP, host: config:getAsString("ftp.host"), port: config:getAsInt("ftp.port"), secureSocket: { basicAuth: { username: config:getAsString("ftp.username"), password: config:getAsString("ftp.password") } } }; ftp:Client ftp = new(ftpConfig); @http:ServiceConfig { basePath: "company" } resource function retreiveFileSize(http:Caller caller, http:Request request) returns error? { http:Response response = new(); var sizeResponse = ftp->size("/home/ftp-user/in/employees.xml"); if (sizeResponse is int) { response.setJsonPayload("File size: " +sizeResponse.toString()); log:printInfo("File size: " + sizeResponse.toString()); } else { response.setJsonPayload({Message: "Error occured in retrieving size", Reason: sizeResponse.reason()}); log:printError("Error occured in retrieving size", sizeResponse); } var httpResult = caller->respond(response); } }
curl http://localhost:9090/company/retreiveFileSize
It only outputs the size of the file, but not the unit.
Affected Product Version: Ballerina Integrator 7.0.1 Ballerina version: 1.0.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description:
$subject.
Steps to Reproduce
curl http://localhost:9090/company/retreiveFileSize
It only outputs the size of the file, but not the unit.
Affected Product Version:
Ballerina Integrator 7.0.1
Ballerina version: 1.0.2
The text was updated successfully, but these errors were encountered: