File tree Expand file tree Collapse file tree 6 files changed +53
-7
lines changed
modules/main/src/main/java/com/annimon/ownlang/modules/okhttp Expand file tree Collapse file tree 6 files changed +53
-7
lines changed Original file line number Diff line number Diff line change 2
2
/.idea /
3
3
/.nb-gradle /
4
4
** /build /
5
- /dist /
6
5
/out /
7
6
/store /
8
7
/optimizations /
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+ (set -o igncr) 2> /dev/null && set -o igncr; # cygwin encoding fix
3
+
4
+ # resolve links - $0 may be a softlink
5
+ PRG=" $0 "
6
+ while [ -h " $PRG " ] ; do
7
+ ls=` ls -ld " $PRG " `
8
+ link=` expr " $ls " : ' .*-> \(.*\)$' `
9
+ if expr " $link " : ' /.*' > /dev/null; then
10
+ PRG=" $link "
11
+ else
12
+ PRG=` dirname " $PRG " ` /" $link "
13
+ fi
14
+ done
15
+ PRGDIR=` dirname " $PRG " `
16
+
17
+ _classpath=" .:$PRGDIR /OwnLang.jar"
18
+ if [ ` uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
19
+ for k in " $PRGDIR " /modules/* .jar
20
+ do
21
+ _classpath=" ${_classpath} ;` cygpath -w ${k} ` "
22
+ done
23
+ for k in " $PRGDIR " /libs/* .jar
24
+ do
25
+ _classpath=" ${_classpath} ;` cygpath -w ${k} ` "
26
+ done
27
+ else
28
+ for k in " $PRGDIR " /modules/* .jar
29
+ do
30
+ _classpath=" ${_classpath} :${k} "
31
+ done
32
+ for k in " $PRGDIR " /libs/* .jar
33
+ do
34
+ _classpath=" ${_classpath} :${k} "
35
+ done
36
+ fi
37
+
38
+ java -cp " ${_classpath} " com.annimon.ownlang.Main " $@ "
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ set JAVA = java
3
+ %JAVA% -cp " %~dp0 /*;%~dp0 modules/*;%~dp0 libs/*" com.annimon.ownlang.Main --file %1
4
+ pause
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+
3
+ set JAVA = java
4
+ %JAVA% ^
5
+ -cp " %~dp0 /*;%~dp0 modules/*;%~dp0 libs/*" com.annimon.ownlang.Main %*
Original file line number Diff line number Diff line change 14
14
public class Values {
15
15
16
16
public static RequestBody getRequestBody (Value arg , String msg ) {
17
- if (arg .type () == Types .MAP && (arg instanceof RequestBodyValue )) {
18
- return (( RequestBodyValue ) arg ) .getRequestBody ();
17
+ if (arg .type () == Types .MAP && (arg instanceof RequestBodyValue rbv )) {
18
+ return rbv .getRequestBody ();
19
19
}
20
20
throw new TypeException ("RequestBody value expected" + msg );
21
21
}
22
22
23
23
public static Request getRequest (Value arg , String msg ) {
24
- if (arg .type () == Types .MAP && (arg instanceof RequestBuilderValue )) {
25
- return (( RequestBuilderValue ) arg ) .getRequest ();
24
+ if (arg .type () == Types .MAP && (arg instanceof RequestBuilderValue rbv )) {
25
+ return rbv .getRequest ();
26
26
}
27
27
throw new TypeException ("Request value expected" + msg );
28
28
}
29
29
30
30
public static OkHttpClient getHttpClient (Value arg , String msg ) {
31
- if (arg .type () == Types .MAP && (arg instanceof HttpClientValue )) {
32
- return (( HttpClientValue ) arg ) .getClient ();
31
+ if (arg .type () == Types .MAP && (arg instanceof HttpClientValue hcv )) {
32
+ return hcv .getClient ();
33
33
}
34
34
throw new TypeException ("HttpClient value expected" + msg );
35
35
}
You can’t perform that action at this time.
0 commit comments