Hi,
I am having a package.
I need to get the package and upload to s3 bucket
I am using the following code
Resource resource = resolver.getResource(packagePath);
File asset=resource.adaptTo(File.class);
S3BucketConnector.uploadPackageToS3(asset);
Where package path will be /etc/packages/Query/query-1.14792.0.zip
resource is returing JcrNodeResource, type=nt:file, superType=null, path=/etc/packages/Query/query-1.14792.0.zip
After adapting asset is always null.
How to proceed with this??
Solved! Go to Solution.
Views
Replies
Total Likes
Hey,
Uploading a file object and uploading package zip file is two different thing. You can transfer the data in binary format but can't upload FIle Object and be hoping that actual package would get uploaded to the destination.
Fundamentally, you need to read the zip file from JCR Node as binary data and post the same binary data to another system.
I hope this helps.
Views
Replies
Total Likes
Try using Java JCR logic to get the file and pass that to uploadPackageToS3(). Something like:
InputStream in = node.getNode("jcr:content").getProperty("jcr:data").getStream();
That should work.
Views
Replies
Total Likes
Hey,
Uploading a file object and uploading package zip file is two different thing. You can transfer the data in binary format but can't upload FIle Object and be hoping that actual package would get uploaded to the destination.
Fundamentally, you need to read the zip file from JCR Node as binary data and post the same binary data to another system.
I hope this helps.
Views
Replies
Total Likes
Views
Likes
Replies