#!/bin/sh

# Include the wrappers utility script
. /usr/lib/java/wrappers.sh

# We need sun runtime.
find_java_runtime sun || { 
    echo "$0: Sun's java not found, some things won't work" >&2
    find_java_runtime || echo "$0: No java found at all ! Aborting" >&2 && 
    exit 1
}
find_jars xercesImpl.jar batik-all.jar fop-transcoder.jar 
find_jars avalon-framework.jar commons-logging.jar commons-io.jar

# We see if there is a -scriptSecurityOn in the commandline
if [ "$1" != -scriptSecurityOn ]; then
    extra_args="-scriptSecurityOff"
else
    shift
    extra_args=""
fi

run_java org.apache.batik.apps.rasterizer.Main $extra_args "$@"
