Hi Martin,

I have changed your plugin a bit and got it to work as you expected,
Basically, cancelException is caught one layer before the plugin, therefore
Artifactory cannot catch the exception thrown and doesn't notice the
rejection.

please try this:

storage {
    beforeDelete { item ->
        def path = item.getRepoPath ()
        def property= "Status.persistency"
        def frozen = repositories.getProperties(path).getFirst(property)
        log.warn "${property} property of '${path}' is ${frozen}"
        if (frozen == "frozen"){
                        log.warn "Cannot delete frozen artifacts"
                        throw new Exception("delete rejected, Cannot delete 
frozen artifacts")  
       }
    } 
}

Hope this helps,
Itamar




--
View this message in context: 
http://forums.jfrog.org/Ignored-CancelException-tp7579108p7579115.html
Sent from the Artifactory - Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to