Class UrlDataExtractor
- java.lang.Object
-
- net.sourceforge.plantuml.servlet.utility.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 Summary
Constructors Constructor Description UrlDataExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getEncodedDiagram(String url)
Get encoded diagram source from URL.static String
getEncodedDiagram(String url, String fallback)
Get encoded diagram source from URL.static int
getIndex(String url)
Get diagram index from URL.static int
getIndex(String url, int fallback)
Get diagram index from URL.
-
-
-
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 inurl
- 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 inurl
- Returns:
- if exists diagram index; otherwise
fallback
-
-