Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "ftp"
version = "2.16.1"
version = "2.17.0"
authors = ["Ballerina"]
keywords = ["FTP", "SFTP", "remote file", "file transfer", "client", "service"]
repository = "https://github.com/ballerina-platform/module-ballerina-ftp"
Expand Down Expand Up @@ -45,8 +45,8 @@ path = "./lib/commons-lang3-3.18.0.jar"
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "ftp-native"
version = "2.16.1"
path = "../native/build/libs/ftp-native-2.16.1-SNAPSHOT.jar"
version = "2.17.0"
path = "../native/build/libs/ftp-native-2.17.0-SNAPSHOT.jar"

[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "ftp-compiler-plugin"
class = "io.ballerina.stdlib.ftp.plugin.FtpCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/ftp-compiler-plugin-2.16.1-SNAPSHOT.jar"
path = "../compiler-plugin/build/libs/ftp-compiler-plugin-2.17.0-SNAPSHOT.jar"
32 changes: 29 additions & 3 deletions ballerina/annotations.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,43 @@
// specific language governing permissions and limitations
// under the License.

# Represents the delete action for file processing.
# When specified, the file will be deleted after processing.
public const DELETE = "DELETE";

# Configuration for moving a file after processing.
#
# + moveTo - Destination directory path where the file will be moved
# + preserveSubDirs - If true, preserves the subdirectory structure relative to the
# listener's root path. Defaults to true.
public type Move record {|
string moveTo;
boolean preserveSubDirs = true;
|};

# Type alias for Move record, used in union types for post-processing actions.
public type MOVE Move;

# Configuration for FTP service remote functions.
# Use this to override default file extension routing for content methods.
# Use this to override default file extension routing for content methods and
# specify automatic file actions after processing.
#
# + fileNamePattern - File name pattern (regex) that should be routed to this method.
# Must be a subset of the listener's `fileNamePattern`.
# + afterProcess - Action to perform after successful processing. Can be DELETE or MOVE.
# If not specified, no action is taken (file remains in place).
# + afterError - Action to perform after processing error. Can be DELETE or MOVE.
# This action is executed immediately after the content handler returns an error or panics.
# If not specified, no action is taken (file remains in place).
public type FtpFunctionConfig record {|
string fileNamePattern;
string fileNamePattern?;
MOVE|DELETE afterProcess?;
MOVE|DELETE afterError?;
|};

# Annotation to configure FTP service remote functions.
# This can be used to specify which file patterns should be handled by a particular content method.
# This can be used to specify which file patterns should be handled by a particular content method
# and what actions to perform after processing.
public annotation FtpFunctionConfig FunctionConfig on service remote function;

# Configuration for FTP service monitoring.
Expand Down
5 changes: 4 additions & 1 deletion ballerina/tests/client_endpoint_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,10 @@ public function testListFiles() {
"/home/in/sc-route-a": 0,
"/home/in/sc-route-b": 0,
"/home/in/sc-single": 0,
"/home/in/sc-legacy": 0
"/home/in/sc-legacy": 0,
"/home/in/post-process": 0,
"/home/in/post-process-archive": 0,
"/home/in/post-process-error": 0
};
FileInfo[]|Error response = (<Client>clientEp)->list("/home/in");
if response is FileInfo[] {
Expand Down
Loading