Class ApiPreconditionCheckerHook

java.lang.Object
org.openstreetmap.josm.actions.upload.ApiPreconditionCheckerHook
All Implemented Interfaces:
UploadHook

public class ApiPreconditionCheckerHook extends Object implements UploadHook
Checks certain basic conditions, that are listed in the OSM API Capabilities.
  • Field Details

  • Constructor Details

  • Method Details

    • checkUpload

      public boolean checkUpload(APIDataSet apiData)
      Description copied from interface: UploadHook
      Check and/or change the data to be uploaded. Default implementation is to approve the upload.
      Specified by:
      checkUpload in interface UploadHook
      Parameters:
      apiData - the data to upload, modify this to change the data.
      Returns:
      true if upload is possible, false to block the upload.
    • checkMaxNodes

      private static boolean checkMaxNodes(Collection<OsmPrimitive> primitives, long maxNodes)
    • valueLengthCheck

      private static boolean valueLengthCheck(OsmPrimitive osmPrimitive)
      Check that the tag values of a primitive are not too long.
      Parameters:
      osmPrimitive - the primitive to check
      Returns:
      false if any tag value of the primitive is too long, true else