forked from orthanc-server/orthanc-setup-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtendingRest.java
More file actions
22 lines (20 loc) · 758 Bytes
/
ExtendingRest.java
File metadata and controls
22 lines (20 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import be.uclouvain.orthanc.Callbacks;
import be.uclouvain.orthanc.HttpMethod;
import be.uclouvain.orthanc.RestOutput;
import java.util.Map;
public class ExtendingRest {
static {
Callbacks.register("/java", new Callbacks.OnRestRequest() {
@Override
public void call(RestOutput output,
HttpMethod method,
String uri,
String[] regularExpressionGroups,
Map<String, String> headers,
Map<String, String> getParameters,
byte[] body) {
output.answerBuffer("Hello from Java!\n".getBytes(), "text/plain");
}
});
}
}