org.encog.util.http
Class URLUtility
- java.lang.Object
-
- org.encog.util.http.URLUtility
-
public final class URLUtility extends java.lang.ObjectURLUtility: A set of useful utilities for processing URL's.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringINDEX_FILEThe name of the usual default document.static intSPECIAL_CHAR_LIMITBeyond this number are special chars.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.net.URLconstructURL(java.net.URL base, java.lang.String url, boolean stripRef)Construct a URL from its basic parts.static booleancontainsInvalidURLCharacters(java.lang.String url)Returns true if the URL contains any invalid characters.static java.lang.StringconvertFilename(java.lang.String base, java.net.URL url, boolean mkdir)Convert a filename for local storage.
-
-
-
Field Detail
-
SPECIAL_CHAR_LIMIT
public static final int SPECIAL_CHAR_LIMIT
Beyond this number are special chars.- See Also:
- Constant Field Values
-
INDEX_FILE
public static final java.lang.String INDEX_FILE
The name of the usual default document.- See Also:
- Constant Field Values
-
-
Method Detail
-
constructURL
public static java.net.URL constructURL(java.net.URL base, java.lang.String url, boolean stripRef) throws java.io.IOExceptionConstruct a URL from its basic parts.- Parameters:
base- The base URL.url- The URL that was found on the base URL's page.stripRef- True if the URL's reference should be stripped.- Returns:
- The new URL, built upon the base URL.
- Throws:
java.io.IOException- Thrown if any IO error occurs.
-
containsInvalidURLCharacters
public static boolean containsInvalidURLCharacters(java.lang.String url)
Returns true if the URL contains any invalid characters.- Parameters:
url- The URL to be checked.- Returns:
- True if the URL contains invalid characters.
-
convertFilename
public static java.lang.String convertFilename(java.lang.String base, java.net.URL url, boolean mkdir)Convert a filename for local storage. Also create the directory tree.- Parameters:
base- The local path that forms the base of the downloaded web tree.url- The URL path.mkdir- Should the directory structure be created.- Returns:
- The resulting local path to store to.
-
-
DMelt 3.0 © DataMelt by jWork.ORG