@Test public void testCreateURL() { String created = ApplicationURL.createURL("krameriusdemo.mzk.cz", "http", "/search/"); Assert.assertEquals("http: }
static String createURL(String headerField, String protocol, String requestUri) { if (headerField.startsWith("/")) headerField = headerField.substring(1); if (headerField.endsWith("/")) headerField = headerField.substring(0, headerField.lastIndexOf('/')); if (requestUri.startsWith("/")) { requestUri = requestUri.substring(1); } String urlString = protocol+": return urlString; }
ApplicationURL { static String createURL(String headerField, String protocol, String requestUri) { if (headerField.startsWith("/")) headerField = headerField.substring(1); if (headerField.endsWith("/")) headerField = headerField.substring(0, headerField.lastIndexOf('/')); if (requestUri.startsWith("/")) { requestUri = requestUri.substring(1); } String urlString = protocol+": return urlString; } }
ApplicationURL { static String createURL(String headerField, String protocol, String requestUri) { if (headerField.startsWith("/")) headerField = headerField.substring(1); if (headerField.endsWith("/")) headerField = headerField.substring(0, headerField.lastIndexOf('/')); if (requestUri.startsWith("/")) { requestUri = requestUri.substring(1); } String urlString = protocol+": return urlString; }  }
ApplicationURL { static String createURL(String headerField, String protocol, String requestUri) { if (headerField.startsWith("/")) headerField = headerField.substring(1); if (headerField.endsWith("/")) headerField = headerField.substring(0, headerField.lastIndexOf('/')); if (requestUri.startsWith("/")) { requestUri = requestUri.substring(1); } String urlString = protocol+": return urlString; }  static String getServerAndPort(HttpServletRequest request); static String applicationURL(HttpServletRequest request); static String extractPort(URL url); static String applicationContextPath(URL url); static String applicationContextPath(HttpServletRequest request); static String urlOfPath(HttpServletRequest request,  String path); static String urlFromRequest(HttpServletRequest httpReq); }
ApplicationURL { static String createURL(String headerField, String protocol, String requestUri) { if (headerField.startsWith("/")) headerField = headerField.substring(1); if (headerField.endsWith("/")) headerField = headerField.substring(0, headerField.lastIndexOf('/')); if (requestUri.startsWith("/")) { requestUri = requestUri.substring(1); } String urlString = protocol+": return urlString; }  static String getServerAndPort(HttpServletRequest request); static String applicationURL(HttpServletRequest request); static String extractPort(URL url); static String applicationContextPath(URL url); static String applicationContextPath(HttpServletRequest request); static String urlOfPath(HttpServletRequest request,  String path); static String urlFromRequest(HttpServletRequest httpReq); static final java.util.logging.Logger LOGGER; }