Add File Content Listener#1499
Conversation
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (62.13%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1499 +/- ##
=============================================
- Coverage 81.78% 62.13% -19.65%
- Complexity 272 392 +120
=============================================
Files 30 45 +15
Lines 1510 2525 +1015
Branches 194 416 +222
=============================================
+ Hits 1235 1569 +334
- Misses 197 812 +615
- Partials 78 144 +66 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add annotation behaviour to override the default extension mapping
Deprecate `onFileChange` and Add `onFileDeleted`
Add test files for the content listener
Fix typos and remove unnecessary logs
Add resources for compiler plugin tests
|
|
@SachinAkash01 I am merging this as it is urgent for the release, Lets track the disabled tests in different issue. |
niveathika
left a comment
There was a problem hiding this comment.
The Module md file needs to be updated with latest docs
compiler-plugin/src/main/java/io/ballerina/stdlib/ftp/plugin/PluginConstants.java
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/stdlib/ftp/plugin/PluginConstants.java
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/stdlib/ftp/plugin/PluginConstants.java
Show resolved
Hide resolved
| MethodType methodType = methodTypeOpt.get(); | ||
|
|
||
| // Fetch file content | ||
| byte[] fileContent = fetchFileContentFromRemote(fileInfo); |
There was a problem hiding this comment.
For stream use cases, we shouldn't read the entire content to memory.


Purpose
The current
ftp:Listenerreports file add/delete events viaonFileChange, exposing metadata only. To process content, developers must invoke a client (Caller->get) inside the handler.This PR adds content-first callbacks to the existing listener, so services can receive file content directly (stream, bytes, text, JSON, XML, CSV) as soon as a file is detected.
Fixes: ballerina-platform/ballerina-library#1490
Examples
Checklist