Package org.zkoss.zats.mimic.operation
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfinish()Invoke this method when uploading finished.voidupload(File file, String contentType)Upload a file to ZK web application.voidupload(String fileName, InputStream content, String contentType)Upload a file from input stream to ZK web application.-
Methods inherited from interface org.zkoss.zats.mimic.Agent
getClient, getDelegatee
-
-
-
-
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.
-
-