Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

4215

June 3rd, 2010 13:00

listObjects with Namespace interface

Using the Java API, I'm trying to list all objects with a specific listable tag and return the full Namespace path of the object.  The problem I'm having is that listObjects returns the objectID.  I see no way to get the full path or the parent directory name given an objectID.  All namespace objects have SystemMetadata called "objname" that contains the name of the file or directory, but this isn't much use with out the path hierarchy.

I'm considering storing the path as UserMetadata, but if there is a standard way to do this, I don't want to reinvent the wheel.

Jason Thornbrugh
Principal Solutions Engineer
GSC Demo Cloud

212 Posts

June 9th, 2010 11:00

Hi Jason,

If the Atmos path is never exposed to users, I'd suggest you store all your files in one standard namespace. Using the namespace interface to upload files to Atmos ensures that the 'objname' attribute gets populated. Also, make sure you store the listable tags when you upload.

When you are looking up objects, use the Listable tags interface and not namespace. When you get the system metadata, you will get back the 'objname' value - using which you can construct the full path. Now, using that path call create shared URL API.

Hope that helps.

Aashish

212 Posts

June 3rd, 2010 14:00

Hi Jason,

AFAIK, you cannot get a path based on an object id (i.e. you can get an object by path but you can't get a path by object).

If your app stores its objects in a standard location, you could construct the path based on your application logic and then get the object.

Thanks,

Aashish

222 Posts

June 7th, 2010 12:00

Jason,

ListObjects is an object interface method that will list objects based on listable tag.

The object interface has no notion of paths or other file system semantics.  If your app needs such funtionality consider using the namespace interface.

You can list directories with the namespace interface.


Raj

18 Posts

June 7th, 2010 14:00

My data is structure in a namepace-like way, but it has metadata assiciated with it that I'd like to store as tags / listable tags.  I guess listable tags aren't designed to be used with namespace.  (Listable tags can be stored, but not listed in a namespace context.)

Jason Thornbrugh
Principal Solutions Engineer
GSC Demo Cloud

222 Posts

June 8th, 2010 06:00

Jason,

You can use listable tags with the namespace interface.

What are you trying to do with tags and namespace objects?

Raj

18 Posts

June 8th, 2010 08:00

I'm storing file objects on Atmos in a custom file sharing application.  The directory names and filenames are arbitrarily defined by users submitting content.  Submitted content can only be seen by users once it has been approved by an administrator.

\projectroot\fileset1\files*

\projectroot\fileset2\files*

\projectroot\fileset3\files*

...

I wanted to use a listable attribute called "publish" to determine which data would be available for download in the webapp.

I was thinking of calling listObjects() and chaining it to getSystemMetadata and getShareableUrl():

listObjects("publish") --> getSystemMetadata() --> getShareableUrl()

However, since the full path name of an object cannot be retrieved, I can't do this directly.  Some alternatives are:

1) Store the full pathname of the object as User Metadata at creation time.

2) Enforce a specific data structure whereby the pathname can be guessed correctly.

3) Store an index of published files/directories external to Atmos Storage

Jason Thornbrugh
Principal Solutions Engineer
GSC Demo Cloud

212 Posts

June 8th, 2010 13:00

>>The directory names and filenames are arbitrarily defined by users  submitting content.

Just curious - Is the directory path determined by your app, or do users enter the directory path?

Thanks,

Aashish

18 Posts

June 8th, 2010 18:00

The path is determined by the user.  The user uploads the data into an FTP cache.  The user then goes into the WebApp and selects a root level directory to push to Atmos.  The directory is processed (zipped, encrypted, and sha1 hashes generated) and then uploaded to Atmos.  On success, the directory and files are purged from the FTP cache.  I actually have enough control of the data that I should be able to use an educated guess to determine the path of the file in this situation.  I was just hoping that Atmos would do the work for me.  :-)

Here's what the files will look like in Atmos.  The words "red", "blue" and "green" are examples of user provided directory names.  The "publish" attribute would be applied to the directory names (red, blue, green).

/app_root/red/red.7z.001

/app_root/red/red.7z.002

/app_root/red/red.7z.003

...

/app_root/blue/blue.7z.001

/app_root/blue/blue.7z.002

/app_root/blue/blue.7z.003

...

/app_root/green/green.7z.001

/app_root/green/green.7z.002

/app_root/green/green.7z.003

...

Jason Thornbrugh
Principal Solutions Engineer
GSC Demo Cloud

18 Posts

June 9th, 2010 13:00

Yes, that should work fine.  I appreciate the input.

Jason Thornbrugh
Principal Solutions Engineer
GSC Demo Cloud

No Events found!

Top