Metadata

View: New views
5 Messages — Rating Filter:   Alert me  

Metadata

by notowidigdo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I created an object that has public access and put user metadata information along with the object.

The question is, can that metadata be accesible by anyone?  Or only by the owner?
If you can, how do I do i access the metadata info from a public object with jet3st?

Cheers,
rgn

Re: Metadata

by James Murty-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

When an S3 object is public all of the object's data is publicly accessible, including the metadata which is simply returned as HTTP headers with the rest of the object.

To access an object's metadata with JetS3t, use the S3Service#getObject or S3Service#getObjectDetails to retrieve an S3Object from S3, then access the metadata using the S3Object#getMetadataMap or S3Object#getModifiableMetadata methods.

James

---
http://www.jamesmurty.com


On Wed, Dec 10, 2008 at 4:04 AM, notowidigdo <rama.notowidigdo@...> wrote:

I created an object that has public access and put user metadata information
along with the object.

The question is, can that metadata be accesible by anyone?  Or only by the
owner?
If you can, how do I do i access the metadata info from a public object with
jet3st?

Cheers,
rgn

--
View this message in context: http://www.nabble.com/Metadata-tp20918900p20918900.html
Sent from the JetS3t Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Metadata

by MarkAtHarvest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

getMetaDataMap() and getModifiableMetadata() do not return any custom meta data fields added to the S3Object using e.g x-amz-description , does not appear over here.

To get hold of description metadata we need to retrieve the S3ObjectDetails,

Following is the sample groovy code for it,

 Calendar cal = Calendar.instance;
        cal.add(Calendar.MINUTE, 5);
        Date expiryDate = cal.getTime();

 org.jets3t.service.utils.signedurl.SignedUrlHandler signedUrlHandler = new RestS3Service(null);
 org.jets3t.service.S3Service  s3 = new RestS3Service(awsCredentials)

  def s3files =  s3.listObjects("trial")

  s3files.each {
         def headUrl =  s3.createSignedHeadUrl(it.bucketName, it.key, awsCredentials, expiryDate, false);
         S3Object objDetails = signedUrlHandler.getObjectDetailsWithSignedUrl(headUrl);
         def description = objDetails.getMetadata("description")
 }

We are retrieving S3Object twice, and somehow I do not know how to get around it, this is kind of a workaround.


notowidigdo wrote:
I created an object that has public access and put user metadata information along with the object.

The question is, can that metadata be accesible by anyone?  Or only by the owner?
If you can, how do I do i access the metadata info from a public object with jet3st?

Cheers,
rgn

Re: Metadata

by James Murty-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm afraid you will need to perform a HEAD or GET request for every object when you need the object's metadata, because the S3 service does not return custom metadata information when you list the objects in a bucket.


On Wed, Jan 14, 2009 at 3:02 AM, MarkAtHarvest <mark@...> wrote:

getMetaDataMap() and getModifiableMetadata() do not return any custom meta
data fields added to the S3Object using e.g x-amz-description , does not
appear over here.

To get hold of description metadata we need to retrieve the S3ObjectDetails,

Following is the sample groovy code for it,

 Calendar cal = Calendar.instance;
       cal.add(Calendar.MINUTE, 5);
       Date expiryDate = cal.getTime();

 org.jets3t.service.utils.signedurl.SignedUrlHandler signedUrlHandler = new
RestS3Service(null);
 org.jets3t.service.S3Service  s3 = new RestS3Service(awsCredentials)

 def s3files =  s3.listObjects("trial")

 s3files.each {
        def headUrl =  s3.createSignedHeadUrl(it.bucketName, it.key,
awsCredentials, expiryDate, false);
        S3Object objDetails =
signedUrlHandler.getObjectDetailsWithSignedUrl(headUrl);
        def description = objDetails.getMetadata("description")
 }

We are retrieving S3Object twice, and somehow I do not know how to get
around it, this is kind of a workaround.



notowidigdo wrote:
>
> I created an object that has public access and put user metadata
> information along with the object.
>
> The question is, can that metadata be accesible by anyone?  Or only by the
> owner?
> If you can, how do I do i access the metadata info from a public object
> with jet3st?
>
> Cheers,
> rgn
>
>

--
View this message in context: http://www.nabble.com/Metadata-tp20918900p21438711.html
Sent from the JetS3t Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Metadata

by MarkAtHarvest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you, thats fine, it works great this way too...

Thanks again for the help and a wondeful library
James Murty-3 wrote:
I'm afraid you will need to perform a HEAD or GET request for every object
when you need the object's metadata, because the S3 service does not return
custom metadata information when you list the objects in a bucket.


On Wed, Jan 14, 2009 at 3:02 AM, MarkAtHarvest <mark@harvestinfotech.com>wrote:

>
> getMetaDataMap() and getModifiableMetadata() do not return any custom meta
> data fields added to the S3Object using e.g x-amz-description , does not
> appear over here.
>
> To get hold of description metadata we need to retrieve the
> S3ObjectDetails,
>
> Following is the sample groovy code for it,
>
>  Calendar cal = Calendar.instance;
>        cal.add(Calendar.MINUTE, 5);
>        Date expiryDate = cal.getTime();
>
>  org.jets3t.service.utils.signedurl.SignedUrlHandler signedUrlHandler = new
> RestS3Service(null);
>  org.jets3t.service.S3Service  s3 = new RestS3Service(awsCredentials)
>
>  def s3files =  s3.listObjects("trial")
>
>  s3files.each {
>         def headUrl =  s3.createSignedHeadUrl(it.bucketName, it.key,
> awsCredentials, expiryDate, false);
>         S3Object objDetails =
> signedUrlHandler.getObjectDetailsWithSignedUrl(headUrl);
>         def description = objDetails.getMetadata("description")
>  }
>
> We are retrieving S3Object twice, and somehow I do not know how to get
> around it, this is kind of a workaround.
>
>
>
> notowidigdo wrote:
> >
> > I created an object that has public access and put user metadata
> > information along with the object.
> >
> > The question is, can that metadata be accesible by anyone?  Or only by
> the
> > owner?
> > If you can, how do I do i access the metadata info from a public object
> > with jet3st?
> >
> > Cheers,
> > rgn
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Metadata-tp20918900p21438711.html
> Sent from the JetS3t Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@jets3t.dev.java.net
> For additional commands, e-mail: users-help@jets3t.dev.java.net
>
>