Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.5k views
in Java FTP by (460 points)
Do you have an example that will be able to stream a file? What I am trying to do is to PGP encrypt a file that your api is reading. The file can get in upwards of 300 megs and I do not want to read all of that into memory.

Thanks,

John

4 Answers

0 votes
by (162k points)
public void get(OutputStream destStream, String remoteFile)

That gets the file's contents to the supplied OutputStream.

If you write a PGPOutputStream you're almost done.
0 votes
by (460 points)
Well actually, I would be leveraging BouncyCastle to perform the PGP encryption. I just wanted to make sure the get method supports streaming.
0 votes
by (320 points)
John,

I am trying to do something similar, using BouncyCastle to do PGP encryption, and EDT for FTP stuff. Each is a separate Web Service deployed on the same server in Tomcat. Whenever I run the PGP Web Service, subsequent runs of my FTP Web Service fail with java.lang.reflect.InvocationTargetException. I have to restart Tomcat in order to run any FTP jobs after a PGP job. It would seem that the classpath is becoming corrupted somehow.

Have you run into this? Any ideas?

Thanks
0 votes
by (460 points)
If you also add the provider to the java.security file under /jre/lib/security and add the bouncycastle provider jar to the \jre\lib\ext directory, this should solve your re-activation problem. What this does it is loaded the bouncycastle provider into memory. So in your code, you don

Categories

...