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 22/.idea /
33/.nb-gradle /
44** /build /
5- /dist /
65/out /
76/store /
87/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 1414public class Values {
1515
1616 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 ();
1919 }
2020 throw new TypeException ("RequestBody value expected" + msg );
2121 }
2222
2323 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 ();
2626 }
2727 throw new TypeException ("Request value expected" + msg );
2828 }
2929
3030 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 ();
3333 }
3434 throw new TypeException ("HttpClient value expected" + msg );
3535 }
You can’t perform that action at this time.
0 commit comments