上传素材 JAVA 示例

public void main(){ 
        try {
            YouZanClient client = new  DefaultYZClient(); 
            YouzanMaterialsStoragePlatformImgUpload youzanMaterialsStoragePlatformImgUpload  = new YouzanMaterialsStoragePlatformImgUpload(); 
            YouzanMaterialsStoragePlatformImgUploadParams params = new YouzanMaterialsStoragePlatformImgUploadParams(); 
            params.setImage(new File("C:\\Users\\chengzhi\\Pictures\\Camera Roll\\1.png")); 
            youzanMaterialsStoragePlatformImgUpload.setAPIParams(params); 
            String invoke = client.invoke(youzanMaterialsStoragePlatformImgUpload, new Token("36aba687b8bb56f01bb56ae355733d07")); 
            log.info(invoke); 
        } catch (SDKException e) {
            log.info(e.getMessage()); 
        } 
    }