public static MaterialAddResult materialAdd(String accessToken,
                                                MediaType type, File media) {
        HttpPost httpPost = new HttpPost(BASE_URI + "/shakearound/material/add");
        FileBody bin = new FileBody(media);
        MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder
                .create().addPart("media", bin);
        HttpEntity reqEntity = multipartEntityBuilder
                .addTextBody(PARAM_ACCESS_TOKEN, API.accessToken(accessToken))
                .addTextBody("type", type.name()).build();
        httpPost.setEntity(reqEntity);
        return LocalHttpClient.executeJsonResult(httpPost,
                MaterialAddResult.class);
    }
public static MaterialAddResult materialAdd ( String accessToken , MediaType type , File media ) { HttpPost httpPost = new HttpPost ( BASE_URI + "/shakearound/material/add" ) ; FileBody bin = new FileBody ( media ) ; MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder . create ( ) . addPart ( "media" , bin ) ; HttpEntity reqEntity = multipartEntityBuilder . addTextBody ( PARAM_ACCESS_TOKEN , API . accessToken ( accessToken ) ) . addTextBody ( "type" , type . name ( ) ) . build ( ) ; httpPost . setEntity ( reqEntity ) ; return LocalHttpClient . executeJsonResult ( httpPost , MaterialAddResult . class ) ; }
上传图片素材

@param accessToken accessToken
@param type        type
@param media       media
@return result