Package com.helger.commons.url
Enum EURLProtocol
- All Implemented Interfaces:
IURLProtocol,Serializable,Comparable<EURLProtocol>,java.lang.constant.Constable
Specifies a list of known protocols.
Should be extended to the list defined at the IANA
Should be extended to the list defined at the IANA
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOSGI bundleSkype.Content ID (RFC 2392)Embedded data (RFC 2397).Local file (RFC 1738).ftp (RFC 1738).ftps.geographic coordinates (RFC 5870).Gopher (RFC 4266).http (RFC 2616).https (RFC 2818).regular JARJavaScriptJava Runtime (JEP 220)LDAP (RFC 4516).Email (RFC 6068).Message ID (RFC 2392)MS Media Server.News (RFC 5538).NNTP (RFC 5538).POP3 (RFC 2384).RSync.RTMPReal time streaming protocol (RFC 2326).Real time streaming protocol (unreliable) (RFC 2326).scp.sftp.shttp (RFC 2660).session initiation protocol (RFC 3261).secure session initiation protocol (RFC 3261).Telephone (RFC 3966).Reference to interactive sessions (RFC 4248).URN (RFC 2141)Web socket (RFC 6455).WebSphere JAREncrypted web socket (RFC 6455).ZIP file -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieve the URL protocol prefix to be used.getWithProtocol(String sURL) Prefix the passed URL with this protocol.getWithProtocolIfNone(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 EURLProtocolReturns 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 Details
-
HTTP
http (RFC 2616). -
HTTPS
https (RFC 2818). -
FILE
Local file (RFC 1738). -
FTP
ftp (RFC 1738). -
BUNDLE
OSGI bundle -
CALLTO
Skype. -
DATA
Embedded data (RFC 2397). -
FTPS
ftps. -
GEO
geographic coordinates (RFC 5870). -
GOPHER
Gopher (RFC 4266). -
JAR
regular JAR -
JAVASCRIPT
JavaScript -
LDAP
LDAP (RFC 4516). -
MAILTO
Email (RFC 6068). -
MMS
MS Media Server. -
NEWS
News (RFC 5538). -
NNTP
NNTP (RFC 5538). -
POP
POP3 (RFC 2384). -
RSYNC
RSync. -
RTMP
RTMP -
RTSP
Real time streaming protocol (RFC 2326). -
RTSPU
Real time streaming protocol (unreliable) (RFC 2326). -
SCP
scp. -
SFTP
sftp. -
SHTTP
shttp (RFC 2660). -
SIP
session initiation protocol (RFC 3261). -
SIPS
secure session initiation protocol (RFC 3261). -
TEL
Telephone (RFC 3966). -
TELNET
Reference to interactive sessions (RFC 4248). -
URN
URN (RFC 2141) -
WS
Web socket (RFC 6455). -
WSJAR
WebSphere JAR -
WSS
Encrypted web socket (RFC 6455). -
ZIP
ZIP file -
CID
Content ID (RFC 2392) -
MID
Message ID (RFC 2392) -
JRT
Java Runtime (JEP 220)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
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
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
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
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.
-