Re: problem to create FTP client

2008-04-19 Thread James Carman
I would set it to something that's more likely to be a block size. Try 1024 or 2048 or something. On 4/19/08, Zoran Jeremic <[EMAIL PROTECTED]> wrote: > James, > > Thank you again. Actually that was the real problem. I missed to close > stream. It works now even with bufferSize=10. > > Do yo

Re: problem to create FTP client

2008-04-19 Thread Zoran Jeremic
James, Thank you again. Actually that was the real problem. I missed to close stream. It works now even with bufferSize=10. Do you have any suggestion about this buffer size? Is it better to put a a higher value in order to prevent performance issue? Regards Zoran James Carma

Re: problem to create FTP client

2008-04-19 Thread James Carman
Did you also make sure you're closing the stream after you copy it? Sometimes, the streams don't actually write the last bit of data unless they're flushed (happens when you close it). So try: copy(fis, os); os.flush(); os.close(); The reason that I don't close the output stream in the copy() me

Re: problem to create FTP client

2008-04-19 Thread Zoran Jeremic
Hi James, Thank you for your help. It works in this way you suggested me but if I set the bufferSize on 1. If I set it for example to 1000 I get black box instead of the class on class diagram picture. I have tried it with very simple project and simple UML diagram. Can you plea

Re: problem to create FTP client

2008-04-19 Thread James Carman
Have you tried closing the output stream? Also, you might want to try copying more than one byte at a time. I usually use a byte[] buffer: public static void copy(InputStream in, OutputStream out, int bufferSize) throws IOException { int bytesRead = -1; final byte[] buffer = new byte[buf

problem to create FTP client

2008-04-19 Thread Zoran Jeremic
Hi, I'm using a commons-net to upload an ArgoUML project (archive with extension .zargo) and its class diagram as picture (.png) to the remote FTP server. Its works fine in case FTP client and FTP server are on the same PC. However, if the FTP client is on other PC it also upload both file