In a
jsp form the user enter the report file URL i.e.,
https://s3.amazonaws.com/cdn.gs.com/live/reports/MVR_Q3_2009.pdf or
cdn.gs.com/live/reports/MVR_Q3_2009.pdf
But when the form is submitted, a
java class(struts2 action) has to checks whether its a valid url by taking the
cdn.gs.com as bucket name and
/reports/MVR_Q3_2009.pdf as file path and then searches in the AWS s3 bucket.
For now we are getting the file_path from the url, but the
cdn.gs.com is entered as a static variable before checking into S3.
Can we get the
cdn.gs.com as bucket_name(
string variable) from the URL
https://s3.amazonaws.com/cdn.gs.com/live/reports/MVR_Q3_2009.pdf or
cdn.gs.com/live/reports/MVR_Q3_2009.pdf