[seek-dev] Re: need a new upload() method in MetacatClient.java

Saurabh Garg sgarg at nceas.ucsb.edu
Thu Sep 2 14:56:09 PDT 2004


Bing,

I have checked in a new method into metacat cvs. It is

    public String upload(String docid, String filename, InputStream 
fileData, int fileSize)

instead of

    public String upload(String docid, byte[] bytes)

The reason is that we dont want to store the file in metacat client code. If 
a user passes bytes array which is more than the memory size, it will crash 
the metacat client. So instead of that, we take an InputStream object.

You will have to update both utilities and metacat cvs modules for this to 
work. For sample code, look in 
edu.ucsb.nceas.metacattest.client.MetacatClientTest (upload_stream() 
function)

Any questions, let me know

-Sid



----- Original Message ----- 
From: "Bing Zhu" <bzhu at sdsc.edu>
To: "Sid" <sgarg at nceas.ucsb.edu>
Cc: "Matt Jones" <jones at nceas.ucsb.edu>; "Jing Tao" <tao at nceas.ucsb.edu>; 
"Bertram Ludaescher" <ludaesch at sdsc.edu>; "Arcot Rajasekar" 
<sekar at sdsc.edu>; "Seek-Dev" <seek-dev at ecoinformatics.org>
Sent: Tuesday, August 31, 2004 10:53 AM
Subject: need a new upload() method in MetacatClient.java


> Sid,
>
> In implemeting Ecogrid's 'put' for Metacat, it will be more
> efficient to have a new upload method for the Ecogrid's
> put service.
>    public String upload(String docid, byte[] bytes)
>
> Currently I can only find the existing one,
>    public String upload(String docid, File file),
> with which the Ecogrid's put service has to save the input byte array
> into a file and then call this method. I am going to implement
> it for now. Once the new method is available, I can just directly
> call the new one. Thanks.
>
> Bing
> 




More information about the Seek-dev mailing list