Skip to content

Instantly share code, notes, and snippets.

@nestoru
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nestoru/10284218 to your computer and use it in GitHub Desktop.
Save nestoru/10284218 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# installGetHttpStatusCode.sh
# @author: Nestor Urquiza
# @date: 20140409
USAGE="Usage: `basename $0` <baseInstallationPath>"
baseInstallationPath=$1
if [ $# -ne "1" ]
then
echo $USAGE
exit 1
fi
installationPath=$baseInstallationPath/http-test
mkdir -p $installationPath
rm -fr $installationPath/*
cd $installationPath
curl -O https://archive.apache.org/dist/httpcomponents/httpclient/binary/httpcomponents-client-4.3.3-bin.tar.gz
tar xvfz httpcomponents-client-4.3.3-bin.tar.gz
curl -o GetHttpStatusCode.java https://gist.githubusercontent.com/nestoru/10281854/raw/13f076926270a205d5237534557837ddbe0f9dbf/GetHttpStatusCode.java
javac -cp ".:./httpcomponents-client-4.3.3/lib/*" GetHttpStatusCode.java
sample_command="cd $installationPath; java -cp \".:./httpcomponents-client-4.3.3/lib/*\" GetHttpStatusCode https://github.com"
echo "Usage Example: $sample_command"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment