public class UrlUtils extends Object
Constructor and Description |
---|
UrlUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
appendParamToUrl(String url,
String paramStr)
Convenience method to append a paramString.
|
static String |
createPageLink(List<String> paramInclude,
List<String> paramIgnore,
String baseUrl,
Map<String,String[]> paramMap,
String suffix)
Re-Create a link with specific params only; cleans by recreating link with required params only
|
static String |
deriveAlternatePath(String originalPathURL,
boolean addPortIfNotExist,
Integer portNum,
String protocol)
Used to derive an alternate URL path.
|
static String |
filterPathName(String filePath,
boolean includeExtension,
boolean fullPath)
File Name filtering Utility
|
static String |
getCDNLocationForResource(String relLocation) |
static Class |
getClassForName(String name,
Class defaultClass)
Filters out the class representing the Page.
|
static String |
getExtension(String filePath)
Returns the extension (including .) at the end of the path else return a blank String
|
static org.apache.wicket.PageParameters |
getPageParameters(String name)
Filters out any additional page parameters
(extracts all URL query values after ?) |
static List<String> |
getPathParams(String url,
Consumer<String> paramEvent)
Read path params separated by '/', upto '?' OR end of path.
|
static String |
getQueryString(String name)
Gets the Query String (after
|
static String |
removeQueryString(String str)
Removes the String after ?..
|
public static String getExtension(String filePath)
filePath
- public static String removeQueryString(String str)
public static String filterPathName(String filePath, boolean includeExtension, boolean fullPath)
filePath
- as the file path to be filteredincludeExtension
- to include the file extension or notfullPath
- : if false will filter from last folder delimiter ('/')public static String appendParamToUrl(String url, String paramStr)
url
- paramStr
- public static String getQueryString(String name)
QueryStringUrlCodingStrategy
has been used to load page.name
- PageParameters
@nullable truepublic static org.apache.wicket.PageParameters getPageParameters(String name)
name
- PageParameters
@nullable truepublic static List<String> getPathParams(String url, Consumer<String> paramEvent)
url
- as String (usually relative URL)paramEvent
- as a Consumer
of each path parampublic static Class getClassForName(String name, Class defaultClass)
name
- defaultClass
- public static String deriveAlternatePath(String originalPathURL, boolean addPortIfNotExist, Integer portNum, String protocol) throws Exception
originalPathURL
- as StringaddPortIfNotExist
- as boolean portNum
- as Integer (the port to be added/replacer in the new path)
protocol
- as String (protocol of the derived path, will replace original path protocol)
Exception
public static String createPageLink(List<String> paramInclude, List<String> paramIgnore, String baseUrl, Map<String,String[]> paramMap, String suffix)
paramInclude
- as List of String params from requestparamIgnore
- as List of String params from request (will override if in conflict with included params)prefix
- as the Opening tag details to this linkbaseUrl
- as StringparamMap
- as Map of String to String[] valuessuffix
- as suffix ending tag details to this linkCopyright © 2018. All rights reserved.