public enum Protocol extends Enum<Protocol>
| Modifier and Type | Method and Description |
|---|---|
static Protocol |
getFrom(String urlString)
This method try to retrieve the protocol indicated by the given URL string.
|
String |
getName() |
static boolean |
isFileUrl(String urlString)
Indicates if the given URL uses FILE protocol
|
static boolean |
isFtpUrl(String urlString)
Indicates if the given URL uses FTP protocol
|
static boolean |
isHttp(String name)
Indicates if the given string represents HTTP protocol.
|
static boolean |
isHttps(String name)
Indicates if the given string represents HTTPS protocol.
|
static boolean |
isHttpUrl(String urlString)
Indicates if the given URL uses HTTP protocol
|
static boolean |
isLdapUrl(String urlString)
Indicates if the given URL uses LDAP protocol
|
boolean |
isTheSame(String urlString)
Indicates if the given URL uses the current protocol
|
static Protocol |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Protocol[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Protocol FILE
public static final Protocol HTTP
public static final Protocol HTTPS
public static final Protocol LDAP
public static final Protocol FTP
public static Protocol[] values()
for (Protocol c : Protocol.values()) System.out.println(c);
public static Protocol valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getName()
public static boolean isHttps(String name)
name - String to be checkedpublic static boolean isHttp(String name)
name - String to be checkedpublic static boolean isFileUrl(String urlString)
urlString - to be checkedpublic static boolean isHttpUrl(String urlString)
urlString - to be checkedpublic static boolean isFtpUrl(String urlString)
urlString - to be checkedpublic static boolean isLdapUrl(String urlString)
urlString - to be checkedpublic boolean isTheSame(String urlString)
urlString - to be checkedCopyright © 2019. All rights reserved.