Class UrlDataExtractor


  • public abstract class UrlDataExtractor
    extends Object
    Utility class to extract the index and diagram source from an URL, e.g., returned by `request.getRequestURI()`.
    • Constructor Detail

      • UrlDataExtractor

        public UrlDataExtractor()
    • Method Detail

      • getIndex

        public static int getIndex​(String url)
        Get diagram index from URL.
        Parameters:
        url - URL to analyse, e.g., returned by `request.getRequestURI()`
        Returns:
        if exists diagram index; otherwise -1
      • getIndex

        public static int getIndex​(String url,
                                   int fallback)
        Get diagram index from URL.
        Parameters:
        url - URL to analyse, e.g., returned by `request.getRequestURI()`
        fallback - fallback index if no index exists in url
        Returns:
        if exists diagram index; otherwise fallback
      • getEncodedDiagram

        public static String getEncodedDiagram​(String url)
        Get encoded diagram source from URL.
        Parameters:
        url - URL to analyse, e.g., returned by `request.getRequestURI()`
        Returns:
        if exists diagram index; otherwise `null`
      • getEncodedDiagram

        public static String getEncodedDiagram​(String url,
                                               String fallback)
        Get encoded diagram source from URL.
        Parameters:
        url - URL to analyse, e.g., returned by `request.getRequestURI()`
        fallback - fallback if no encoded diagram source exists in url
        Returns:
        if exists diagram index; otherwise fallback