Last change
on this file since 5085 was 5085, checked in by simon04, 12 years ago |
fix #5824 - remotecontrol: add command for opening local files + refactoring of permission preference
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.io.remotecontrol.handler;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
|
---|
7 | import org.openstreetmap.josm.io.remotecontrol.RequestProcessor;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Handler for version request.
|
---|
11 | */
|
---|
12 | public class VersionHandler extends RequestHandler {
|
---|
13 |
|
---|
14 | public static final String command = "version";
|
---|
15 |
|
---|
16 | @Override
|
---|
17 | protected void handleRequest() throws RequestHandlerErrorException,
|
---|
18 | RequestHandlerBadRequestException {
|
---|
19 | content = RequestProcessor.PROTOCOLVERSION;
|
---|
20 | contentType = "application/json";
|
---|
21 | if (args.containsKey("jsonp")) {
|
---|
22 | content = args.get("jsonp") + " && " + args.get("jsonp") + "(" + content + ")";
|
---|
23 | }
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Override
|
---|
27 | public String getPermissionMessage() {
|
---|
28 | return tr("Remote Control has been asked to report its protocol version. This enables web sites to detect a running JOSM.");
|
---|
29 | }
|
---|
30 |
|
---|
31 | @Override
|
---|
32 | public PermissionPrefWithDefault getPermissionPref() {
|
---|
33 | return PermissionPrefWithDefault.READ_PROTOCOL_VERSION;
|
---|
34 | }
|
---|
35 |
|
---|
36 | @Override
|
---|
37 | public String[] getMandatoryParams() {
|
---|
38 | return null;
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.