Package com.helger.commons.url
Enum EURLProtocol
- java.lang.Object
-
- java.lang.Enum<EURLProtocol>
-
- com.helger.commons.url.EURLProtocol
-
- All Implemented Interfaces:
IURLProtocol,Serializable,Comparable<EURLProtocol>
public enum EURLProtocol extends Enum<EURLProtocol> implements IURLProtocol
Specifies a list of known protocols.
Should be extended to the list defined at the IANA- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BUNDLEOSGI bundleCALLTOSkype.CIDContent ID (RFC 2392)DATAEmbedded data (RFC 2397).FILELocal file (RFC 1738).FTPftp (RFC 1738).FTPSftps.GEOgeographic coordinates (RFC 5870).GOPHERGopher (RFC 4266).HTTPhttp (RFC 2616).HTTPShttps (RFC 2818).JARregular JARJAVASCRIPTJavaScriptJRTJava Runtime (JEP 220)LDAPLDAP (RFC 4516).MAILTOEmail (RFC 6068).MIDMessage ID (RFC 2392)MMSMS Media Server.NEWSNews (RFC 5538).NNTPNNTP (RFC 5538).POPPOP3 (RFC 2384).RSYNCRSync.RTMPRTMPRTSPReal time streaming protocol (RFC 2326).RTSPUReal time streaming protocol (unreliable) (RFC 2326).SCPscp.SFTPsftp.SHTTPshttp (RFC 2660).SIPsession initiation protocol (RFC 3261).SIPSsecure session initiation protocol (RFC 3261).TELTelephone (RFC 3966).TELNETReference to interactive sessions (RFC 4248).URNURN (RFC 2141)WSWeb socket (RFC 6455).WSJARWebSphere JARWSSEncrypted web socket (RFC 6455).ZIPZIP file
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsForQueryParameters()StringgetProtocol()Retrieve the URL protocol prefix to be used.StringgetWithProtocol(String sURL)Prefix the passed URL with this protocol.StringgetWithProtocolIfNone(String sURL)Prefix the passed URL with this protocol if the URL does not have a protocol yet.booleanisUsedInURL(String sURL)Tells if the passed String (URL) belongs to this protocol.static EURLProtocolvalueOf(String name)Returns the enum constant of this type with the specified name.static EURLProtocol[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HTTP
public static final EURLProtocol HTTP
http (RFC 2616).
-
HTTPS
public static final EURLProtocol HTTPS
https (RFC 2818).
-
FILE
public static final EURLProtocol FILE
Local file (RFC 1738).
-
FTP
public static final EURLProtocol FTP
ftp (RFC 1738).
-
BUNDLE
public static final EURLProtocol BUNDLE
OSGI bundle
-
CALLTO
public static final EURLProtocol CALLTO
Skype.
-
DATA
public static final EURLProtocol DATA
Embedded data (RFC 2397).
-
FTPS
public static final EURLProtocol FTPS
ftps.
-
GEO
public static final EURLProtocol GEO
geographic coordinates (RFC 5870).
-
GOPHER
public static final EURLProtocol GOPHER
Gopher (RFC 4266).
-
JAR
public static final EURLProtocol JAR
regular JAR
-
JAVASCRIPT
public static final EURLProtocol JAVASCRIPT
JavaScript
-
LDAP
public static final EURLProtocol LDAP
LDAP (RFC 4516).
-
MAILTO
public static final EURLProtocol MAILTO
Email (RFC 6068).
-
MMS
public static final EURLProtocol MMS
MS Media Server.
-
NEWS
public static final EURLProtocol NEWS
News (RFC 5538).
-
NNTP
public static final EURLProtocol NNTP
NNTP (RFC 5538).
-
POP
public static final EURLProtocol POP
POP3 (RFC 2384).
-
RSYNC
public static final EURLProtocol RSYNC
RSync.
-
RTMP
public static final EURLProtocol RTMP
RTMP
-
RTSP
public static final EURLProtocol RTSP
Real time streaming protocol (RFC 2326).
-
RTSPU
public static final EURLProtocol RTSPU
Real time streaming protocol (unreliable) (RFC 2326).
-
SCP
public static final EURLProtocol SCP
scp.
-
SFTP
public static final EURLProtocol SFTP
sftp.
-
SHTTP
public static final EURLProtocol SHTTP
shttp (RFC 2660).
-
SIP
public static final EURLProtocol SIP
session initiation protocol (RFC 3261).
-
SIPS
public static final EURLProtocol SIPS
secure session initiation protocol (RFC 3261).
-
TEL
public static final EURLProtocol TEL
Telephone (RFC 3966).
-
TELNET
public static final EURLProtocol TELNET
Reference to interactive sessions (RFC 4248).
-
URN
public static final EURLProtocol URN
URN (RFC 2141)
-
WS
public static final EURLProtocol WS
Web socket (RFC 6455).
-
WSJAR
public static final EURLProtocol WSJAR
WebSphere JAR
-
WSS
public static final EURLProtocol WSS
Encrypted web socket (RFC 6455).
-
ZIP
public static final EURLProtocol ZIP
ZIP file
-
CID
public static final EURLProtocol CID
Content ID (RFC 2392)
-
MID
public static final EURLProtocol MID
Message ID (RFC 2392)
-
JRT
public static final EURLProtocol JRT
Java Runtime (JEP 220)
-
-
Method Detail
-
values
public static EURLProtocol[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EURLProtocol c : EURLProtocol.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EURLProtocol valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getProtocol
@Nonnull @Nonempty public String getProtocol()
Description copied from interface:IURLProtocolRetrieve the URL protocol prefix to be used. May contain "//".- Specified by:
getProtocolin interfaceIURLProtocol- Returns:
- The underlying text representation of the protocol.
-
isUsedInURL
public boolean isUsedInURL(@Nullable String sURL)
Tells if the passed String (URL) belongs to this protocol.- Specified by:
isUsedInURLin interfaceIURLProtocol- Parameters:
sURL- The URL to check. May benull.- Returns:
trueif the passed URL starts with this protocol
-
getWithProtocol
@Nullable public String getWithProtocol(@Nullable String sURL)
Description copied from interface:IURLProtocolPrefix the passed URL with this protocol.- Specified by:
getWithProtocolin interfaceIURLProtocol- Parameters:
sURL- The URL to be prefixed. May benull.- Returns:
nullif the parameter isnull. The protocol is prepended independent whether the URL already has a protocol or not.
-
getWithProtocolIfNone
@Nullable public String getWithProtocolIfNone(@Nullable String sURL)
Description copied from interface:IURLProtocolPrefix the passed URL with this protocol if the URL does not have a protocol yet.- Specified by:
getWithProtocolIfNonein interfaceIURLProtocol- Parameters:
sURL- The URL to be prefixed. May benull.- Returns:
nullif the parameter isnull. The protocol is prepended if the URL not already has a protocol.
-
allowsForQueryParameters
public boolean allowsForQueryParameters()
- Specified by:
allowsForQueryParametersin interfaceIURLProtocol- Returns:
trueif this protocol can handle HTTP query parameters (?x=y&z=1),falseif not.
-
-