I have already a code to retrieve the objects in the bucket using oci-java-sdk and this is working as expected. I would like to retrieve the URL of the file which was uploaded to the bucket in object storage and when I use this URL, this should redirect to the actual location without asking any credentials. I saw preauthenticated requests but again i need to create one more request. I dont want to send one more request and want to get URL in the existing GetObjectResponse. Any suggestions> Thanks, js
Getting the URL for a bucket or an object using oci-java-sdk
4k Views Asked by JSAT At
1
There are 1 best solutions below
Related Questions in ORACLE-CLOUD-INFRASTRUCTURE
- Bare Metal Cloud - Python SDK SSL/TLS exception
- How to connect oracle Cloud Instance using Oracle Cloud Shell?
- How to connect to OCI machine if the sshd is not responding?
- The total amount of free network bandwidth an always free compute can use for a month or some period of time
- Terraform and OCI : "The existing Db System with ID <OCID> has a conflicting state of UPDATING" when creating multiple databases
- Not able to configure Elasticsearch snapshot repository using OCI Amazon S3 Compatibility API
- Connect Oracle Autonomous Database in Microsoft Azure Data Factory
- how to get a Pre-Authenticated request for an object in OCI object storage using python SDK?
- Should com.oracle.bmc.monitoring.MonitoringClient be closed every time after querying for metrics?
- How to upload data with cyrillic in Oracle ADW?
- Reuse Load Balancer for K8s Services
- how to connect to oracle free cloud using mobaxterm?
- Using swift style access with rclone and non-classic OCI object storage
- how to get all IP in VNIC [Oracle Cloud Using API]
- I finalized Oracle Cloud Always Free Boot Volumes
Related Questions in OCI-JAVA-SDK
- Error Uploading to OCI Object Storage - org.glassfish.hk2.api.UnsatisfiedDependencyException:
- OCI-SDK Object Storage : org.glassfish.hk2.api.UnsatisfiedDependencyException
- Accessing object storage bucket with a pre-authenticated request using oci java sdk
- In OCI Java sdk, how to retrieve the information abou the URL of ML user, APEX user
- What are the required maven dependencies to upload files to oracle object storage from Spring Boot 3.0 and Java 17?
- Automate the login process of Oracle Cloud Interface
- in OCI Java sdk, how to retrieve the autonomous database username and apex workspace restful url?
- Facing a Client instance has been closed issue when using InstancePrincipalsLoginModule
- Upload a MultipartFile to a Oracle ObjectStorage
- Error Generating the Pre-Authenticated URL from Oracle Cloud Storage (oci-java-sdk)
- Error in creating secret: com.oracle.bmc.model.BmcException: (400, InvalidParameter, false) stage must be one of CURRENT
- Getting the URL for a bucket or an object using oci-java-sdk
- Resource ownership of GetObjectResponse.InputStream
- Reason for failure in MultipartObjectAssembler OCI object storage
- Should com.oracle.bmc.monitoring.MonitoringClient be closed every time after querying for metrics?
Related Questions in ORACLE-CLOUD-INFRASTRUCTURE-CLASSIC
- How to connect VMs with private IPs owned by different users
- How do I restore a whole bucket of archived objects in Oracle cloud?
- Need steps to configure Oracle Cloud Infrastructure on Jenkins agent
- in Oracle Autonomous database try to create an workspace in the plsql program by using the apex_util.create_user. but failed
- OIC - Microsoft SQL Server Connector Error when used Merge Operation
- How to add cloud flare's ips to Oracle cloud infrastructure whitelist
- Cannot find or login to Oracle Cloud DB
- Oracle DB Instance on oracle cloud free tier disappeared
- Django's runserver on Oracle Cloud?
- Getting the URL for a bucket or an object using oci-java-sdk
- API to collect public IP addresses of Oracle Cloud
- ERR-7620 Could not determine workspace for application ()
- What is the Difference between Oracle Cloud Infrastructure and Oracle Database Classic?
- How to send mail from Oracle DBCS with Office365 account?
- How to debug custom component in Oracle Digital Assistant?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The URL of an object is not returned from the API but can be built using information you know (See Update Below!). The pattern is:
https://{api_endpoint}/n/{namespace_name}/b/{bucket_name}/o/{object_name}
Accessing that URL will (generally, see below) require authentication. Our authentication mechanism is described at:
https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm
Authentication is NOT required if you configure the bucket as a Public Bucket.
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/managingbuckets.htm?TocPath=Services%7CObject%20Storage%7C_____2#publicbuckets
As you mentioned, Pre-authenticated Requests (PARs) are an option. They are generally used in this situation, and they work well.
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/usingpreauthenticatedrequests.htm
Strictly speaking, it is also possible to use our Amazon S3 Compatible API...
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm
...and S3's presigned URLs to generate (without involving the API) a URL that will work without additional authentication.
https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
Update: A teammate pointed out that the OCI SDK for Java now includes a getEndpoint method that can be used to get the hostname needed when querying the Object Storage API. https://docs.cloud.oracle.com/en-us/iaas/tools/java/1.25.3/com/oracle/bmc/objectstorage/ObjectStorage.html#getEndpoint--