Package net.sourceforge.plantuml.servlet
Class ProxyServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- net.sourceforge.plantuml.servlet.ProxyServlet
-
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class ProxyServlet extends jakarta.servlet.http.HttpServlet
Proxy servlet of the webapp. This servlet retrieves the diagram source of a web resource (web html page) and renders it.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProxyServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
static boolean
forbiddenURL(String full)
static HttpURLConnection
getConnection(URL url)
Get open http connection from URL.static URL
validateURL(String url, jakarta.servlet.http.HttpServletResponse response)
Validate external URL.-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
forbiddenURL
public static boolean forbiddenURL(String full)
-
validateURL
public static URL validateURL(String url, jakarta.servlet.http.HttpServletResponse response) throws IOException
Validate external URL.- Parameters:
url
- URL to validateresponse
- response object to `sendError` including error message; if `null` no error will be send- Returns:
- valid URL; otherwise `null`
- Throws:
IOException
- `response.sendError` can result in a `IOException`
-
doGet
public void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
- Overrides:
doGet
in classjakarta.servlet.http.HttpServlet
- Throws:
IOException
jakarta.servlet.ServletException
-
getConnection
public static HttpURLConnection getConnection(URL url) throws IOException
Get open http connection from URL.- Parameters:
url
- URL to open connection- Returns:
- open http connection
- Throws:
IOException
- if an input or output exception occurred
-
-