Skip to content

Instantly share code, notes, and snippets.

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mulesoft.ion</groupId>
<artifactId>testcli</artifactId>
<name>Test CLI tools</name>
<version>1.0</version>
<dependencies>
<dependency>
import com.mulesoft.jockey.*;
@Command("test")
@Options([
@Option(name="n",longName="name",description="Your name",optional=false)
])
public class TestCommand extends GroovyCommand {
void execute() {
println "Hello " + name;
}
}
/**
* Honor semantics of chmod as best we can in pure Java. Note, this uses reflection to be
* more tolerant of different Java versions.
*/
public class Chmod {
private static final boolean CHMOD_API_AVAILABLE;
private static final Method setWritable;
private static final Method setReadable;
private static final Method setExecutable;
<flow name="test">
<inbound-endpoint address="http://localhost/edit/something" exchange-pattern="request-response"/>
<http:basic-security-filter realm="mule-realm"/>
<shiro:authorization-filter permission="write"/>
... logic which requires write access
</flow>
<shiro:security-manager>
<shiro:delegate-security-provider name="in-memory" delegate-ref="securityManager"/>
</shiro:security-manager>
<spring:bean id="securityManager" class="org.apache.shiro.mgt.DefaultSecurityManager">
<spring:property name="realm" ref="myRealm"/>
</spring:bean>
<spring:bean id="myRealm" class="org.mule.module.shiro.TextConfigurationRealm">
<spring:property name="userDefinitions">