private String uploadSliceControl(UploadSliceFileRequest request) throws AbstractCosException {
		String url = buildUrl(request);
		long signExpired = System.currentTimeMillis() / 1000 + this.config.getSignExpired();
		String sign = Sign.getPeriodEffectiveSign(request.getBucketName(), request.getCosPath(), this.cred, signExpired);

		long fileSize = 0;
		String shaDigest = "";
		try {
			String localPath = request.getLocalPath();
			fileSize = CommonFileUtils.getFileLength(localPath);
			shaDigest = CommonCodecUtils.getEntireFileSha1(localPath);
		} catch (Exception e) {
			throw new UnknownException(e.toString());
		}

		HttpRequest httpRequest = new HttpRequest();
		httpRequest.setUrl(url);
		httpRequest.addHeader(RequestHeaderKey.Authorization, sign);
		httpRequest.addHeader(RequestHeaderKey.USER_AGENT, this.config.getUserAgent());

		httpRequest.addParam(RequestBodyKey.OP, RequestBodyValue.OP.UPLOAD_SLICE);
		httpRequest.addParam(RequestBodyKey.SHA, shaDigest);
		httpRequest.addParam(RequestBodyKey.FILE_SIZE, String.valueOf(fileSize));
		httpRequest.addParam(RequestBodyKey.SLICE_SIZE, String.valueOf(request.getSliceSize()));
		httpRequest.addParam(RequestBodyKey.BIZ_ATTR, request.getBizAttr());
		httpRequest.addParam(RequestBodyKey.INSERT_ONLY, String.valueOf(request.getInsertOnly().ordinal()));

		return httpClient.sendHttpRequest(httpRequest);
	}
private String uploadSliceControl ( UploadSliceFileRequest request ) throws AbstractCosException { String url = buildUrl ( request ) ; long signExpired = System . currentTimeMillis ( ) / 1000 + this . config . getSignExpired ( ) ; String sign = Sign . getPeriodEffectiveSign ( request . getBucketName ( ) , request . getCosPath ( ) , this . cred , signExpired ) ; long fileSize = 0 ; String shaDigest = "" ; try { String localPath = request . getLocalPath ( ) ; fileSize = CommonFileUtils . getFileLength ( localPath ) ; shaDigest = CommonCodecUtils . getEntireFileSha1 ( localPath ) ; } catch ( Exception e ) { throw new UnknownException ( e . toString ( ) ) ; } HttpRequest httpRequest = new HttpRequest ( ) ; httpRequest . setUrl ( url ) ; httpRequest . addHeader ( RequestHeaderKey . Authorization , sign ) ; httpRequest . addHeader ( RequestHeaderKey . USER_AGENT , this . config . getUserAgent ( ) ) ; httpRequest . addParam ( RequestBodyKey . OP , RequestBodyValue . OP . UPLOAD_SLICE ) ; httpRequest . addParam ( RequestBodyKey . SHA , shaDigest ) ; httpRequest . addParam ( RequestBodyKey . FILE_SIZE , String . valueOf ( fileSize ) ) ; httpRequest . addParam ( RequestBodyKey . SLICE_SIZE , String . valueOf ( request . getSliceSize ( ) ) ) ; httpRequest . addParam ( RequestBodyKey . BIZ_ATTR , request . getBizAttr ( ) ) ; httpRequest . addParam ( RequestBodyKey . INSERT_ONLY , String . valueOf ( request . getInsertOnly ( ) . ordinal ( ) ) ) ; return httpClient . sendHttpRequest ( httpRequest ) ; }
上传控制分片

@param request
分片上传请求
@return JSON格式的字符串, 格式为{"code":$code, "data":{}}, code为0表示成功,
data为一个JSON结构体,详情请参见WIKI
@throws AbstractCosException
SDK定义的COS异常, 通常是输入参数有误或者环境问题(如网络不通)