|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.util.net.NetworkUtils
Collection of network related utility methods.
| Field Summary | |
private static String |
DEFAULT_HTTP_PREFIX
The default http prefix |
static String[] |
DEFAULT_NEWSFEED_FILE_EXTENSIONS
The default newsfeed file extensions |
| Constructor Summary | |
NetworkUtils()
|
|
| Method Summary | |
static String |
addHttp(String url)
Adds the default http:// prefix to the specified url. |
static String |
extractFilename(String url)
Extracts the filename from the specified url
String.
|
static String |
extractFilename(URL url)
Extracts the filename from the specified URL.
|
static Program |
getDefaultBrowser()
Gets the Program used as default browser on the system.
|
static String |
getHostUrl(String url)
Gets a valid url host String from the specified
url, i.e. strips off everything besides the protocol and
host from the given url.
|
static boolean |
isNewsFeed(String url)
Returns true if the specified url is a potential
newsfeed juding on the default newsfeed file extensions as
deposited in DEFAULT_NEWSFEED_FILE_EXTENSIONS.
|
static boolean |
isValidUrl(String url)
Tests if the specified url is valid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final String DEFAULT_HTTP_PREFIX
The default http prefix
public static final String[] DEFAULT_NEWSFEED_FILE_EXTENSIONS
The default newsfeed file extensions
| Constructor Detail |
public NetworkUtils()
| Method Detail |
public static boolean isValidUrl(String url)
Tests if the specified url is valid. This does not have to mean that that it is reachable too.
url - the url to test for validity
true if the specified url is valid;
false if invalidpublic static String addHttp(String url)
Adds the default http:// prefix to the specified url. If it already contains the default http:// prefix it remains unmodified.
url - the url to add the http:// prefix to
public static String extractFilename(URL url)
Extracts the filename from the specified URL.
url - the URL to extract the filename of
public static String extractFilename(String url)
Extracts the filename from the specified url
String.
url - the url to extract the filename of
public static boolean isNewsFeed(String url)
Returns true if the specified url is a potential
newsfeed juding on the default newsfeed file extensions as
deposited in DEFAULT_NEWSFEED_FILE_EXTENSIONS.
url - the url to verify
false otherwisepublic static String getHostUrl(String url)
Gets a valid url host String from the specified
url, i.e. strips off everything besides the protocol and
host from the given url.
url - the url to determine the host from
null if an invalid url
was specifiedpublic static Program getDefaultBrowser()
Gets the Program used as default browser on the system.
Program used as default browser on the system;
null if no default browser set
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||