Swift Object storage allow you to create a temporary URL for any resource with an expiry date. This can be achieved with swift CLI command line. To make use of this functionality in an web application, I need to achieve the creation of temporary URL using API call, So that I can make a rest CALL and get the temp URL which can later be embedded in HTML and resource downloaded by the we browser directly.
From the documentation I dont see any API mentioned for this ? Do anyone know how i can get it from Java using API call.
Thanks Manoj
For other people looking for the answer in java, Below is the code snippet to get the hmac in java
The above code is taken from https://gist.github.com/ishikawa/88599
Use the hmac to create the temporary URL as per the below code
Thanks
There is no direct API available to generate temporary URL for Swift objects. Instead it has to generated from client side with the help of X-Account-Meta-Temp-URL-Key secret key as per described in this document
Here is the python version of code to generate it. Refer this to re-implement it in Java and then it can be embedded anywhere.
Here is an another reference, which is a customization done to Openstack Horizon to provide an UI feature to generate swift objects temp URL.