Package nl.vpro.util

Class URLPathEncode

java.lang.Object
nl.vpro.util.URLPathEncode

public class URLPathEncode extends Object
Since:
1.64.1
Author:
Michiel Meeuwissen
  • Constructor Details

    • URLPathEncode

      public URLPathEncode()
  • Method Details

    • encode

      public static @PolyNull String encode(@PolyNull String input)
      Escapes every character of the input string for the path part of a URL.

      This differs from URLEncoder.encode(String, String) that it will leave more characters untouched (see isSafe(char), and that space will be replaced by +;

    • encode

      public static @PolyNull String encode(@PolyNull String input, boolean spaceIsPlus)
      Escapes every character of the input string for the path part of a URL.
      See Also:
    • decode

      public static @PolyNull String decode(@PolyNull String s)
    • encodePath

      public static @PolyNull String encodePath(@PolyNull String input)
      Escapes every character of the input string for the path part of an URL, but only after splitting it by /. Afterwards join with '/' again. This avoids that the / itself is escaped too, and this function can be used to escape all the constituents of a path separately.
    • encodePath

      public static @PolyNull String encodePath(@PolyNull String input, boolean spaceIsPlus)