[seek-dev] metacat 'put' implementation

Bing Zhu bzhu at sdsc.edu
Mon Aug 30 12:17:07 PDT 2004


Hi Jing,

Since you implemented 'get' for Metacat, I think it will be more appropriate
to ask you the followings.

In 'get', it seems the service gets the filename from the document with the
following code.
    String filepath = MetaCatUtil.getOption("datafilepath");
    if(!filepath.endsWith("/"))
    {
             filepath += "/";
    }
    String filename = filepath + docid;
And then the 'get' service read data from the file for user.

As Matt mentioned in previous mail, the 'put' should be implemented in
parallel. Therefore, the 'put'
for a file will be implemented as of followings.
     (The put function has syntax:  put(byte[] objData, String objectId, int
objType, int sessionId)  )

    1. open the document with doc ID, 'objectId'. if the doc doesn't exist,
return an error.
    2. compose filename  ---> what's your algorithm to build this
filename???
    3. Create a new file with filename from (2) and write data into the
file.
    4. Save filename info into the metacat document for 'objectId'.

Let me know if my understanding is correct. Thanks.

Bing




More information about the Seek-dev mailing list