view Sphinx/source/plugins/java/ExtendingRest.java @ 1123:292479b06402

security: authentication wrt RemoteAccess
author Alain Mazy <am@orthanc.team>
date Thu, 19 Dec 2024 08:17:02 +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");
            }
        });
    }
}