|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pepper.platform.util.URLUtils
public class URLUtils
Utility methods for dealing with URLs.
Constructor Summary | |
---|---|
URLUtils()
|
Method Summary | |
---|---|
static URL |
checkURL(String location)
|
static File |
fileURLToFile(URL url)
This routine converts an absolute File URL to a File representing the resource |
static String |
getAttrValue(String queryString,
String attribute)
Searches the queryString of the URL for the specified attribute and will return it's value |
static String |
getAttrValue(URL theURL,
String attribute)
Searches the queryString of the URL for the specified attribute and will return it's value |
static String |
getExtension(String fileName)
Get the file extension from the given file name |
static String |
getExtension(URL u)
Get the file extension from the given url |
static String |
getFileNoExtension(URL u)
Get the file name without the extension |
static String |
insertBeforeExtension(URL pepperURL,
String textToInsert)
Inserts a string into the filename before the extension of the file. |
static URL |
makeJarFileURL(String jarFilePath,
String resourceName)
Make a jar file url |
static String |
makeJarFileURL(String jarFilePath,
String jarFileName,
String resourceName)
Make a jar file url |
static String |
normalize(String path)
Return the canonical version of the given path by resolving ".." "." and "//" elements. |
static HashMap |
parseQueryString(String queryString)
Parse a URL query string, typically in the format atr1=value1&attr2=value2&attr3=value3. |
static HashMap |
parseQueryString(URL theURL)
Parse a URL query string, typically in the format http://foo.com? atr1=value1&attr2=value2&attr3=value3. |
static File |
pepperURLToFile(URL url,
String baseDir)
This routine converts a relative pepperURL to a File representing the resource |
static URL |
stripQueryString(URL theURL)
Strip the query string from a URL and return the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLUtils()
Method Detail |
---|
public static URL stripQueryString(URL theURL)
theURL
- URL to process
public static HashMap parseQueryString(URL theURL)
theURL
- a String
value
HashMap
valuepublic static HashMap parseQueryString(String queryString)
queryString
- Either just the queryString portion or the
entire URL (containing the query string) as a string
HashMap
valuepublic static String getAttrValue(URL theURL, String attribute)
theURL
- an URL
valueattribute
- a String
value
String
valuepublic static String getAttrValue(String queryString, String attribute)
queryString
- The queryString typically in the form
attr1=value1&attr2=value2attribute
- a String
value
String
valuepublic static String normalize(String path)
path
- the path to be normalized.
public static URL makeJarFileURL(String jarFilePath, String resourceName)
jarFilePath
- a String
valueresourceName
- a String
value
URL
valuepublic static String makeJarFileURL(String jarFilePath, String jarFileName, String resourceName)
jarFilePath
- a String
valuejarFileName
- a String
valueresourceName
- a String
value
String
valuepublic static URL checkURL(String location)
public static String getExtension(URL u)
u
- the url to search
public static String getExtension(String fileName)
fileName
- The name of the file
public static String getFileNoExtension(URL u)
u
- an URL
value
String
valuepublic static File pepperURLToFile(URL url, String baseDir)
url
- an URL
valuebaseDir
- a String
value
File
valuepublic static File fileURLToFile(URL url)
url
- an URL
value
File
valuepublic static String insertBeforeExtension(URL pepperURL, String textToInsert)
pepperURL
- an URL
valuetextToInsert
- a String
value
String
representing the string of the path with
the leading / removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |