On Friday 08 August 2008 12:47, Julien Cornuwel wrote:
> toad at freenetproject.org a ?crit :
> > Author: toad
> > Date: 2008-08-05 20:01:18 +0000 (Tue, 05 Aug 2008)
> > New Revision: 21627
> >
> > Modified:
> >    trunk/freenet/src/freenet/client/HighLevelSimpleClient.java
> >    trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
> > Log:
> > Non-blocking inserts too
> 
> > +   public void insert(InsertBlock insert, boolean getCHKOnly, String 
filenameHint, boolean isMetadata, InsertContext ctx, ClientCallback cb) 
throws InsertException {
> > +           ClientPutter put = new ClientPutter(cb, insert.getData(), 
insert.desiredURI, insert.clientMetadata,
> > +                           ctx, core.requestStarters.chkPutScheduler, 
core.requestStarters.sskPutScheduler, priorityClass,
> > +                           getCHKOnly, isMetadata, this, null, 
> > filenameHint, false);
> > +           put.start(false);
> > +   }
> 
> Can you give an example on how I should use it ? To feed it the
> InsertBlock, I have to create a Bucket, which I didn't find the
> implementation...
> 
> Typically, I want to feed it with an OutputStream (or a file) and get it
> inserted in an SSK.

There are loads of implementations of Bucket in freenet/support/io. If you 
want to create a temporary bucket (like a tempfile, only encrypted), use the 
factories on NodeClientCore. If you want to feed it a file, make a 
FileBucket. If you want to feed it an array of bytes, feed it an ArrayBucket, 
etc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080808/1f151bd8/attachment.pgp>

Reply via email to