Class SysProtocol

  • All Implemented Interfaces:
    Protocol

    public class SysProtocol
    extends java.lang.Object
    implements Protocol
    • Constructor Detail

      • SysProtocol

        public SysProtocol()
        The default c'tor -- instantiate a Protocol object.
      • SysProtocol

        public SysProtocol​(AuthenticationHandler authenticationHandler,
                           java.net.URLStreamHandler urlStreamHandler)
    • Method Detail

      • get

        public java.io.InputStream get​(java.lang.String sUrl)
        Method to get (download) a file designated by the given URL.
        Specified by:
        get in interface Protocol
        Parameters:
        sUrl - the URL to download.
        Returns:
        an InputStream that contains the downloaded data.
        Throws:
        ExFull - "Couldn't read/get data from '%s'." exception.
      • put

        public void put​(java.lang.String sFileName,
                        java.lang.String sUrl)
        Method to put (upload) the given file to a file designated by the given URL.
        Specified by:
        put in interface Protocol
        Parameters:
        sFileName - the file to upload.
        sUrl - the name of the URL to upload to.
        Throws:
        ExFull - "stream implementation unavailable" exception.
      • put

        public void put​(java.io.InputStream iFile,
                        java.lang.String sUrl)
        Method to put (upload) memory to a designated URL. The Internet server targeted by the URL must obviously be configured to allow uploads.
        Specified by:
        put in interface Protocol
        Parameters:
        iFile - the InputStream to be uploaded to the URL.
        sUrl - the name of the URL to upload memory to.
      • post

        public Protocol.PostRsvp post​(Protocol.SimplePostData oData,
                                      java.lang.String sUrl)
        Method to post form data to a designated URL. The targeted URL must obviously be designed to read the data posted.
        Specified by:
        post in interface Protocol
        Parameters:
        oData - a description of the data being posted to the URL.
        sUrl - the name of the URL to post data to.
        Returns:
        The status and response from the Post as a PostRsvp object.
      • post

        public Protocol.PostRsvp post​(java.util.List<? extends Protocol.MultiPartDesc> oData,
                                      java.lang.String sUrl)
        Virtual method to post form data to a designated URL. The targeted URL must obviously be designed to read the data posted.
        Specified by:
        post in interface Protocol
        Parameters:
        oData - a description of the data being posted to the URL.
        sUrl - the name of the URL to post data to.
        Returns:
        The status and response from the Post as a PostRsvp object
      • getURLStreamHandler

        public java.net.URLStreamHandler getURLStreamHandler()
        Description copied from interface: Protocol
        Gets the protocol's URL stream handler. This method is required for all implementations of custom protocols and must return a non-null value.
        Specified by:
        getURLStreamHandler in interface Protocol
        Returns:
        an URL stream handler.
      • isTrusted

        public boolean isTrusted​(java.lang.String sURL,
                                 Protocol.TrustType eTrustType,
                                 boolean bThrow)
        Description copied from interface: Protocol
        Determines if the given URL can be trusted according to the given type of enforcement rule.
        Specified by:
        isTrusted in interface Protocol
        Parameters:
        sURL - the URL to be trusted.
        eTrustType - the type of trust enforcement needed.
        bThrow - when true, requests that a trust exception (ExFull) be thrown if the URL is not trusted.
        Returns:
        true if trusted, otherwise false.
      • scheme

        public java.lang.String scheme()
        Description copied from interface: Protocol
        Gets the protocol's scheme. This method is required for all implementations of custom protocols and must return a non-null, non-empty value.
        Specified by:
        scheme in interface Protocol
        Returns:
        this protocol's scheme.