Enum EURLProtocol

java.lang.Object
java.lang.Enum<EURLProtocol>
com.helger.commons.url.EURLProtocol
All Implemented Interfaces:
IURLProtocol, Serializable, Comparable<EURLProtocol>, java.lang.constant.Constable

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 Details

    • 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 Details

    • values

      public static EURLProtocol[] 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

      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 name
      NullPointerException - if the argument is null
    • getProtocol

      @Nonnull @Nonempty public String getProtocol()
      Description copied from interface: IURLProtocol
      Retrieve the URL protocol prefix to be used. May contain "//".
      Specified by:
      getProtocol in interface IURLProtocol
      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:
      isUsedInURL in interface IURLProtocol
      Parameters:
      sURL - The URL to check. May be null.
      Returns:
      true if the passed URL starts with this protocol
    • getWithProtocol

      @Nullable public String getWithProtocol(@Nullable String sURL)
      Description copied from interface: IURLProtocol
      Prefix the passed URL with this protocol.
      Specified by:
      getWithProtocol in interface IURLProtocol
      Parameters:
      sURL - The URL to be prefixed. May be null.
      Returns:
      null if the parameter is null. 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: IURLProtocol
      Prefix the passed URL with this protocol if the URL does not have a protocol yet.
      Specified by:
      getWithProtocolIfNone in interface IURLProtocol
      Parameters:
      sURL - The URL to be prefixed. May be null.
      Returns:
      null if the parameter is null. The protocol is prepended if the URL not already has a protocol.
    • allowsForQueryParameters

      public boolean allowsForQueryParameters()
      Specified by:
      allowsForQueryParameters in interface IURLProtocol
      Returns:
      true if this protocol can handle HTTP query parameters (?x=y&z=1), false if not.