-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathsetenv-zip.sh
More file actions
executable file
·41 lines (34 loc) · 1.69 KB
/
Copy pathsetenv-zip.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.69 KB
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
#!/bin/bash
# Purpose: Use to set up environment to compile and run examples if ESAPI
# downloaded as a zip file.
# Usage: From csh, tcsh:
# $ source ./setenv-zip.sh
# From most other *nix shells:
# $ . ./setenv-zip.sh
#
# where '$' represents the shell command line prompt.
###########################################################################
esapi_resources="$(\cd ../../../configuration/esapi >&- 2>&- && pwd)"
esapi_resources_test="$(\cd ../../../src/test/resources/esapi >&- 2>&- && pwd)"
# Here we don't look for the specific versions of the dependent libraries
# since the specific version of the library is delivered as part of the
# ESAPI zip file. In this manner, we do not have to update this if these
# versions change.
esapi_classpath=".:\
$(ls ../../../esapi*.jar):\
$(./findjar.sh -start ../../../libs commons-fileupload-*.jar):\
$(./findjar.sh -start ../../../libs servlet-api-*.jar)"
if [[ ! -r "$esapi_resources"/ESAPI.properties ]]
then echo >&2 "setenv-zip.sh: Can't read ESAPI.properties in $esapi_resources"
return 1 # Don't use 'exit' here or it will kill their current shell.
fi
if [[ ! -r "$esapi_resources_test"/ESAPI.properties ]]
then echo >&2 "setenv-zip.sh: Can't read ESAPI.properties in $esapi_resources_test"
return 1 # Don't use 'exit' here or it will kill their current shell.
fi
echo ############################################################
echo "esapi_resources=$esapi_resources"
echo "esapi_resources_test=$esapi_resources_test"
echo "esapi_classpath=$esapi_classpath"
echo ############################################################
export esapi_classpath esapi_resources esapi_resources_test