source: josm/trunk/src/org/openstreetmap/josm/actions/upload/UploadHook.java@ 13632

Last change on this file since 13632 was 13028, checked in by Don-vip, 7 years ago

fix #15464 - Allow plugins to modify the changeset tags before upload (patch by rorym)

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions.upload;
3
4import java.util.Map;
5
6import org.openstreetmap.josm.data.APIDataSet;
7
8/**
9 * Change, or block, the upload.
10 *
11 * The UploadHook may modify the uploaded data silently, it may display a
12 * warning message to the user or prevent the upload altogether.
13 *
14 * The tags of the changeset can also be changed with modifyChangesetTags method.
15 */
16public interface UploadHook {
17
18 /**
19 * Check, and/or change, the data to be uploaded.
20 * Default implementation is to approve the upload.
21 * @param apiDataSet the data to upload, modify this to change the data.
22 * @return {@code true} if upload is possible, {@code false} to block the upload.
23 */
24 default boolean checkUpload(APIDataSet apiDataSet) {
25 return true;
26 }
27
28 /**
29 * Modify the changeset tags (in place) before upload.
30 * Default implementation is to do no changes.
31 * @param tags The current tags to change
32 * @since 13028
33 */
34 default void modifyChangesetTags(Map<String, String> tags) {
35 }
36}
Note: See TracBrowser for help on using the repository browser.