Class MetadataIndexSupport


  • public final class MetadataIndexSupport
    extends Object
    Support methods for metadata indexing.
    • Constructor Detail

      • MetadataIndexSupport

        private MetadataIndexSupport()
        Constructor.
    • Method Detail

      • canonicalizeLocationURI

        @Nonnull
        public static String canonicalizeLocationURI​(@Nonnull
                                                     String input)
                                              throws MalformedURLException
        Canonicalize a location to be indexed.

        Query, fragment and username/password are removed. Then further canonicalization is performed as implemented by SimpleURLCanonicalizer.

        Parameters:
        input - the location
        Returns:
        the canonicalized location value to index
        Throws:
        MalformedURLException - if URL can not be canonicalized
      • trimURLPathSegment

        @Nullable
        public static String trimURLPathSegment​(@Nullable
                                                String input)
        Trim the right-most segment from the specified URL path.

        The input should be the path only, with no query or fragment.

        Paths ending in "/" return the input with the trailing slash omitted, except for the special case of input == "/", which returns null. Paths not ending in "/" return the input with the right-most segment removed, and including a trailing slash.

        Parameters:
        input - the path to evaluate
        Returns:
        the trimmed path, or null