Skip to content

Commit

Permalink
Update sample.krl
Browse files Browse the repository at this point in the history
  • Loading branch information
helamanl0424 authored Mar 25, 2024
1 parent 3328d82 commit 4a289f0
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions samples/sample.krl
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@ ruleset sample_app {

rule store_file {
select when sample_app store_file
pods:store(pods:getStorage + event:attrs.get("fetchFileURL"), event:attrs.get("storeLocation"))
pods:store(event:attrs.get("fetchFileURL"), pods:getStorage + event:attrs.get("storeLocation"))
}
rule overwrite_file {
select when sample_app overwrite_file
pods:overwrite(pods:getStorage + event:attrs.get("fetchFileURL"), event:attrs.get("storeLocation"))

rule test_overwrite_file_with_name {
select when test overwrite_file
if (event:attrs.get("fileName")) then
pods:overwrite(event:attrs.get("originURL"), pods:getStorage + event:attrs.get("destinationURL"), event:attrs.get("fileName"))
}

rule test_overwrite_file_no_name {
select when test overwrite_file
if (not event:attrs.get("fileName")) then
pods:overwrite(event:attrs.get("originURL"), pods:getStorage + event:attrs.get("destinationURL"))
}

rule remove_file {
select when sample_app remove_file
pods:removeFile(pods:getStorage + event:attrs.get("fileURL"))
Expand Down Expand Up @@ -84,7 +93,7 @@ ruleset sample_app {
rule ls {
select when sample_app ls
pre {
list = pods:listItems(pods:getStorage + event:attrs.get("directoryURL"))
list = pods:listItems(pods:getStorage + event:attrs.get("fileURL"))
}
send_directive(list)
}
Expand All @@ -93,4 +102,4 @@ ruleset sample_app {
select when sample_app find
pods:findFile(event:attrs.get("fileName"))
}
}
}

0 comments on commit 4a289f0

Please sign in to comment.