Java Code Examples for com.alipay.api.FileItem#getContent()

The following examples show how to use com.alipay.api.FileItem#getContent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RequestCheckUtils.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
public static void checkMaxLength(FileItem fileItem, int maxLength, String fieldName)
        throws AlipayApiException {
    try {
        if (fileItem != null && fileItem.getContent() != null) {

            if (fileItem.getContent().length > maxLength) {
                throw new AlipayApiException(ERROR_CODE_ARGUMENTS_INVALID,
                        "client-error:Invalid Arguments:the length of " + fieldName
                                + " can not be larger than " + maxLength + ".");
            }
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
Example 2
Source File: RequestCheckUtils.java    From alipay-sdk with Apache License 2.0 5 votes vote down vote up
public static void checkMaxLength(FileItem fileItem, int maxLength, String fieldName)
                                                                                        throws AlipayApiException {
	try {
		if(fileItem!=null&&fileItem.getContent()!=null){
			
			if(fileItem.getContent().length>maxLength){
                   throw new AlipayApiException(ERROR_CODE_ARGUMENTS_INVALID,
                       "client-error:Invalid Arguments:the length of " + fieldName
                               + " can not be larger than " + maxLength + ".");
			}
		}
	} catch (IOException e) {
		throw new RuntimeException(e);
	}
}
 
Example 3
Source File: RequestCheckUtils.java    From pay with Apache License 2.0 5 votes vote down vote up
public static void checkMaxLength(FileItem fileItem, int maxLength, String fieldName)
                                                                                        throws AlipayApiException {
	try {
		if(fileItem!=null&&fileItem.getContent()!=null){
			
			if(fileItem.getContent().length>maxLength){
                   throw new AlipayApiException(ERROR_CODE_ARGUMENTS_INVALID,
                       "client-error:Invalid Arguments:the length of " + fieldName
                               + " can not be larger than " + maxLength + ".");
			}
		}
	} catch (IOException e) {
		throw new RuntimeException(e);
	}
}