Closed furkanozbay closed 3 years ago
Performing file based upload (described in here: https://support.huaweicloud.com/en-us/sdk-java-devg-obs/obs_21_0603.html) gives error.
Version: 3.20.6
In RequestConvertor class
RequestConvertor
long fileSize = request.getFile().length();
this line raised error because of method call, length(), on null object: request.getFile()
length()
request.getFile()
This is caused from this line
request.setInput(new FileInputStream(request.getFile()));
When you set input to request it sets file to null. This is the setInput method in PutObjectRequest class
PutObjectRequest
public void setInput(InputStream input) { this.input = input; this.file = null; }
Thanks for your suggestion, this place is indeed a problem and has been fixed in 3.20.6.1:https://mvnrepository.com/artifact/com.huaweicloud/esdk-obs-java/3.20.6.1
Performing file based upload (described in here: https://support.huaweicloud.com/en-us/sdk-java-devg-obs/obs_21_0603.html) gives error.
Version: 3.20.6
In
RequestConvertor
classthis line raised error because of method call,
length()
, on null object:request.getFile()
This is caused from this line
When you set input to request it sets file to null. This is the setInput method in
PutObjectRequest
class