Skip to content

Commit 2c450b3

Browse files
committed
fix(ch4s4): refactor java source for SG read ease
1 parent a4c63d7 commit 2c450b3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
package com.redhat.training.example.javaserverhost.rest;
22

3-
43
import javax.ws.rs.Path;
54
import javax.ws.rs.core.Response;
65
import javax.ws.rs.GET;
76
import javax.ws.rs.Produces;
87
import java.net.InetAddress;
98

10-
119
@Path("/")
1210
public class ServerHostEndPoint {
1311

14-
@GET
15-
@Produces("text/plain")
16-
public Response doGet() {
17-
String host = "";
18-
try {
19-
host = InetAddress.getLocalHost().getHostName();
20-
}
21-
catch (Exception e) {
22-
e.printStackTrace();
23-
}
24-
return Response.ok("I am running on server "+host+" Version 1.0 \n").build();
25-
}
12+
@GET
13+
@Produces("text/plain")
14+
public Response doGet() {
15+
String host = "";
16+
try {
17+
host = InetAddress.getLocalHost().getHostName();
18+
}
19+
catch (Exception e) {
20+
e.printStackTrace();
21+
}
22+
String msg = "I am running on server "+host+" Version 1.0 \n"
23+
return Response.ok(msg).build();
24+
}
2625
}
26+

0 commit comments

Comments
 (0)