view Sphinx/source/plugins/java/ExtendingRest.java @ 1127:e129ba893299 default tip

added Emilio Huaman
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 Jan 2025 17:35:16 +0100
parents df28170c2af3
children
line wrap: on
line source

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");
            }
        });
    }
}