/usr/lib/surfraw/javasun is in surfraw 2.2.9-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #!/bin/sh
# $Id$
# elvis: javasun -- Search Java API docs (java.sun.com)
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_java_product se
def SURFRAW_java_version 6
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
Search Sun Java API docs (java.sun.com)
Local options:
-v Java API version (1.2, 1.3, 1.4, 5, 6)
-p Java product (se, ee, me)
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-v*) setopt SURFRAW_java_version $optarg ;;
-p*) setopt SURFRAW_java_product $optarg ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
case "$SURFRAW_java_product" in
[sS][eE])
case "$SURFRAW_java_version" in
6) JAVA_SITE="javase/6/docs/api" ;;
5) JAVA_SITE="j2se/1.5.0/docs/api" ;;
1.4) JAVA_SITE="j2se/1.4.2/docs/api" ;;
1.3) JAVA_SITE="j2se/1.3/docs/api" ;;
*)
echo "Docs for J2SE $SURFRAW_java_version are not available"
exit 1 ;;
esac ;;
[eE][eE])
case "$SURFRAW_java_version" in
6|5) JAVA_SITE="javaee/5/docs/api" ;;
1.4) JAVA_SITE="j2ee/1.4/docs/api" ;;
1.3) JAVA_SITE="j2ee/sdk_1.3/techdocs/api" ;;
1.2) JAVA_SITE="j2ee/sdk_1.2.1/techdocs/api" ;;
*) echo "Docs for J2EE $SURFRAW_java_version are not available"
esac ;;
[mM][eE])
JAVA_SITE="j2me/docs" ;;
*)
echo "$SURFRAW_java_product is not a valid Java product"
exit 1 ;;
esac
if test -z "$w3_args"; then
w3_browse_url "http://download.oracle.com/${JAVA_SITE}"
else
button=`w3_url_escape "I'm Feeling Lucky"`
escaped_args=`w3_url_of_arg $w3_args`
w3_browse_url "http://www.google.com/search?q=${escaped_args}&sitesearch=download.oracle.com/${JAVA_SITE}&btnI=${button}"
fi
|