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.
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.
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.
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
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():
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
aashishpatil
2 Intern
•
212 Posts
1192
0
Posted 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