private String addToString(String source, char separator, String toBeInserted) {
int index = source.lastIndexOf(separator);
if(index >= 0 && index < source.length())
return source.substring(0, index) + toBeInserted + source.substring(index);
else
return null;
}
Category: Java
CXF logging via interceptors
In case you need to see what you’re passing to a web service via CXF, add the following in you web client XML (i.e. cucumber.xml):
<property name=”inInterceptors”>
<util:list>
<bean class=”org.apache.cxf.interceptor.LoggingInInterceptor”/>
</util:list>
</property>
<property name=”outInterceptors”>
<util:list>
<bean class=”org.apache.cxf.interceptor.LoggingOutInterceptor”/>
</util:list>
</property>
Accepted boolean XML inputs
Adding for archival purposes: http://xformsinstitute.com/essentials/browse/re45.php
true, 1, false, 0 are valid.
Playing with .jar files
For archival purposes.
Operation | Command |
---|---|
To create a JAR file | jar cf <em>jar-file input-file(s)</em> |
To view the contents of a JAR file | jar tf <em>jar-file</em> |
To extract the contents of a JAR file | jar xf <em>jar-file</em> |
To extract specific files from a JAR file | jar xf <em>jar-file archived-file(s)</em> |
To run an application packaged as a JAR file (version 1.1) |
jre -cp <em>app.jar MainClass</em> |
To run an application packaged as a JAR file (version 1.2 — requires Main-Class manifest header) |
java -jar <em>app.jar</em> |
To invoke an applet packaged as a JAR file | <applet code=<em>AppletClassName.class</em> archive="<em>JarFileName.jar</em>" width=<em>width</em> height=<em>height</em>> </applet> |