[Kde-java] KIO Slave in Java
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Fri Feb 27 19:00:28 CET 2004
Hi Daniel
On Friday 27 February 2004 17:19, Daniel Hanlon wrote:
> Hope I've not missed something blindingly obvious here but I'm a bit
> confused about how to implement a KIOSlave with the java kde bindings.
> I've got the bindings compiled and a few trial programmes to work. However,
> I really want to use the bindings to implement a new KIOSlave for a
> protocol (GridFTP) where there is an available jar implementing the
> transport layer.
>
> From what I can see, the requirement that KIO launch the slave via kdeinit
> means that I should write a bit of C++ to call the java code extending
> SlaveBase using JNI.
>
> Am I missing a simpler way of doing this?
I'm afraid I'm not much of a kioslave expert, and I'd only been thinking of
using existing kioslaves from java. Have you had a look at the example in
kdejava//koala/test/kioslave - it was converted from C++ code ok? I've
attached it to this mail anyway..
>From the code, this seems quite low level - I don't know if GridFTP would work
off something like it:
case Get:
myJob = KIO.get( src, true );
connect(myJob, SIGNAL("data( Job, byte[])"),
SLOT("slotData( Job, byte[])"));
break;
case Put:
putBuffer = 0;
myJob = KIO.put( src, -1, true, false);
connect(myJob, SIGNAL("dataReq( Job, ByteArrayOutputStream)"),
SLOT("slotDataReq( Job, ByteArrayOutputStream)"));
break;
So I'm not sure if you have to useJNI - I would have thought if you are
wanting to go java <-> java and so it should be possible to avoid it.
-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KioslaveTest.java
Type: text/x-java
Size: 15023 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-java/attachments/20040227/7750c312/KioslaveTest.bin
More information about the Kde-java
mailing list