Class ApiInvoker


  • public class ApiInvoker
    extends Object
    API invoker class
    • Constructor Detail

      • ApiInvoker

        public ApiInvoker​(IRequestHandler[] requestHandlers,
                          Configuration configuration)
        Initializes a new instance of the ApiInvoker class.
        Parameters:
        requestHandlers - The request handlers.
        configuration - The configuration.
    • Method Detail

      • invokeApi

        public byte[] invokeApi​(String path,
                                String method,
                                String body,
                                HashMap<String,​String> headerParams,
                                HashMap<String,​Object> formParams)
                         throws Exception
        Invokes the API.
        Parameters:
        path - The path.
        method - The method.
        body - The body.
        headerParams - The header parameters.
        formParams - The form parameters.
        Returns:
        Resulting data.
        Throws:
        Exception
      • invokeApi

        public byte[] invokeApi​(String path,
                                String method,
                                String body,
                                HashMap<String,​String> headerParams,
                                HashMap<String,​Object> formParams,
                                String contentType)
                         throws Exception
        Invokes the API.
        Parameters:
        path - The path.
        method - The method.
        body - The body.
        headerParams - The header parameters.
        formParams - The form parameters.
        contentType - Type of the content.
        Returns:
        Resulting data.
        Throws:
        Exception
      • toFileInfo

        public FileInfo toFileInfo​(InputStream stream,
                                   String paramName)
                            throws IOException
        Converts stream to the file information parameter.
        Parameters:
        stream - The stream.
        paramName - Name of the parameter.
        Returns:
        File information parameter.
        Throws:
        IOException
      • toFileInfo

        public FileInfo toFileInfo​(byte[] data,
                                   String paramName)
        Converts bytes to the file information parameter.
        Parameters:
        data - The data bytes.
        paramName - Name of the parameter.
        Returns:
        File information parameter.
      • toFileInfo

        public FileInfo toFileInfo​(byte[] data)
        Converts bytes to the file information parameter.
        Parameters:
        data - The data bytes.
        Returns:
        File information parameter.