Skip to content

Commit 9b96dc2

Browse files
committed
Change Dockerfile because of issue on build echo.java
1 parent e3a9a9b commit 9b96dc2

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ RUN go get -u github.com/golang/lint/golint
1818
WORKDIR /go/src/github.com/buger/gor/
1919
ADD . /go/src/github.com/buger/gor/
2020

21-
RUN javac -cp /tmp/commons-io-2.4/commons-io-2.4.jar ./examples/middleware/echo.java
21+
RUN wget http://archive.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.tar.gz && tar xzf commons-io-2.4-bin.tar.gz && cd commons-io-2.4 && mv commons-io-2.4.jar /tmp/
22+
RUN wget http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.9-bin.tar.gz && tar xzf commons-codec-1.9-bin.tar.gz
23+
RUN javac -cp commons-io-2.4/commons-io-2.4.jar -cp commons-codec-1.9/commons-codec-1.9.jar ./examples/middleware/echo.java
2224
RUN go get

examples/middleware/echo.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
import org.apache.commons.codec.binary.Hex;
77

88

9-
public class Echo {
10-
public static String decodeHexString(String s) throws DecoderException {
11-
return new String(Hex.decodeHex(s.toCharArray()));
12-
}
9+
class Echo {
10+
public static String decodeHexString(String s) throws DecoderException {
11+
return new String(Hex.decodeHex(s.toCharArray()));
12+
}
1313

14-
public static String encodeHexString(String s) {
15-
return new String(Hex.encodeHex(s.getBytes()));
16-
}
14+
public static String encodeHexString(String s) {
15+
return new String(Hex.encodeHex(s.getBytes()));
16+
}
1717

18-
public static String transformHTTPMessage(String req) {
19-
// do actual transformations here
20-
return req;
21-
}
18+
public static String transformHTTPMessage(String req) {
19+
// do actual transformations here
20+
return req;
21+
}
2222

2323
public static void main(String[] args) throws DecoderException {
2424
if(args != null){
@@ -29,7 +29,7 @@ public static void main(String[] args) throws DecoderException {
2929
}
3030

3131
BufferedReader stdin = new BufferedReader(new InputStreamReader(
32-
System.in));
32+
System.in));
3333
String line = null;
3434

3535
try {

0 commit comments

Comments
 (0)