public class HelpUtilities
extends java.lang.Object
Constructor and Description |
---|
HelpUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
getChildURL(java.net.URL parentURL,
java.lang.String path)
Return an URL by its relative path from a parent URL.
|
static java.net.URL |
getEntryURL(java.net.URL parentURL,
java.lang.String path)
Return an URL by its relative path from a parent URL.
|
static java.lang.String |
getFileExtension(java.net.URL url)
Return the extension of a URL.
|
static java.lang.String |
getFileNameWithExtension(java.net.URL url)
Return the URL name without the path, nor the extension.
|
static java.net.URL |
getParentURL(java.net.URL url)
Return the parent URL of a given URL.
|
static java.lang.String |
getRelativePath(java.net.URL originURL,
java.net.URL url)
Return the path of an URL relative to a directory.
|
static java.net.URL |
getStyleSheet(java.net.URL url) |
static boolean |
isAtLeastVersion(java.lang.String javaVersion)
Return true if the current Java version is at least equal to the specified version.
|
static boolean |
isHTML(java.net.URL url) |
static boolean |
isHTTP(java.net.URL url)
Return true if an URL use the http protocol.
|
static boolean |
isHTTPProtocol(java.net.URL url)
Return true if the protocol is a http, or https protocol.
|
static boolean |
isJarProtocol(java.net.URL url)
Return true if the protocol is a jar protocol.
|
static boolean |
isRelative(java.net.URL baseURL,
java.net.URL url)
Return the path of an URL relative to a directory.
|
static java.net.URL |
normalize(java.net.URL url)
Normalize an URL by removing "." and ".." in the path part of the URL.
|
static java.lang.String |
normalizeString(java.lang.String st)
Replaces white space characters by underscores.
|
public static java.lang.String normalizeString(java.lang.String st)
st
- the Stringpublic static java.lang.String getFileNameWithExtension(java.net.URL url)
url
- the URLpublic static java.net.URL getEntryURL(java.net.URL parentURL, java.lang.String path) throws java.net.MalformedURLException
parentURL
- the parent URLpath
- the path of the child relative to the parentjava.net.MalformedURLException
public static java.net.URL getStyleSheet(java.net.URL url)
public static java.net.URL getParentURL(java.net.URL url)
url
- the URLpublic static java.net.URL getChildURL(java.net.URL parentURL, java.lang.String path)
parentURL
- the parent URLpath
- the path of the child relative to the parentpublic static java.lang.String getRelativePath(java.net.URL originURL, java.net.URL url)
originURL
- the origin URLurl
- the URLpublic static java.net.URL normalize(java.net.URL url)
url
- the URLpublic static boolean isHTTPProtocol(java.net.URL url)
url
- the URLpublic static boolean isJarProtocol(java.net.URL url)
url
- the URLpublic static boolean isRelative(java.net.URL baseURL, java.net.URL url)
baseURL
- the base directoryurl
- the URLpublic static java.lang.String getFileExtension(java.net.URL url)
url
- the URLpublic static boolean isHTTP(java.net.URL url)
url
- the URLpublic static boolean isHTML(java.net.URL url)
public static final boolean isAtLeastVersion(java.lang.String javaVersion)
For example, if the current version is 1.7.0_13, the result would be, depending on the specified Java version:
javaVersion
- the specified Java versionCopyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence