Interface UploadAgent

  • All Superinterfaces:
    Agent, OperationAgent

    public interface UploadAgent
    extends OperationAgent
    The agent for files uploading operation. Supported components with upload property such as Button, Menuitem and Toolbarbutton. DesktopAgent can be UploadAgent for specific case such as uploading by Fileupload.get(). Notice that you should use the same instance in one uploading iteration.
    Since:
    1.1.0
    Author:
    pao
    • Method Detail

      • upload

        void upload​(String fileName,
                    InputStream content,
                    String contentType)
        Upload a file from input stream to ZK web application. The input stream won't be closed, it should be closed manually.
        Parameters:
        fileName - specify name for uploading file, should not be null.
        content - content of uploaded file, should not be null.
        contentType - specify type of content. If null, indicate it is binary form.
        See Also:
        Internet media type
      • upload

        void upload​(File file,
                    String contentType)
        Upload a file to ZK web application.
        Parameters:
        file - file for uploading, should not be null.
        contentType - specify type of content. If null, indicate it is binary form.
        See Also:
        Internet media type
      • finish

        void finish()
        Invoke this method when uploading finished.