use of com.emc.atmos.api.request.CreateObjectRequest in project camel by apache.
the class AtmosAPIFacade method putSingleFile.
private ObjectId putSingleFile(File inputFile, String atmosPath) throws Exception {
FileInputStream inputStream = new FileInputStream(inputFile);
ObjectId uploadedFile = null;
try {
ObjectPath op = new ObjectPath(atmosPath);
CreateObjectRequest request = new CreateObjectRequest();
request.identifier(op).content(inputStream).contentLength(inputFile.length());
uploadedFile = AtmosAPIFacade.client.createObject(request).getObjectId();
return uploadedFile;
} finally {
inputStream.close();
}
}
Aggregations