Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > apache FTPClient

Reply
Thread Tools

apache FTPClient

 
 
Bricker, M.
Guest
Posts: n/a
 
      02-12-2009
when I retrieve a file using FTPClient, the data is corrupted (I know
this because the file is no longer readable by the application using
the data). I tried specifying file time either ascii or binary. same
problem either way. I was wondering if the outputstream messes with
the data, since it is in bytes. The application (being c++) writes
and read in (char*). Thanks.
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      02-13-2009
Bricker, M. wrote:
> when I retrieve a file using FTPClient, the data is corrupted (I know
> this because the file is no longer readable by the application using
> the data). I tried specifying file time either ascii or binary. same
> problem either way. I was wondering if the outputstream messes with
> the data, since it is in bytes. The application (being c++) writes
> and read in (char*). Thanks.


If you implemented the "outputstream [sic]" with java.io.OutputStream then it
didn't "mess with" the data. I don't know anything about 'FTPClient', though
- where does it come from?

If 'FTPClient' is a Java class or project, then it isn't retrieving the file
using an output stream but using an input stream, probably a subclass or
variant of java.io.InputStream.

Whatever is writing to the output stream might be doing something to the data.
You haven't indicated what it is, so it's hard to know. What is writing
the data to the output stream?

Your comment that "[t]he application (being c++ [sic]) writes and read [sic]
in (char*)" is a bit ambiguous. I assume you mean that it uses a 'char'
pointer to locate a (C++) 'char' array and is using it as a byte array.

I don't see how anyone here can help you with such a dearth of information.

--
Lew
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      02-13-2009
Bricker, M. wrote:
> when I retrieve a file using FTPClient, the data is corrupted (I know
> this because the file is no longer readable by the application using
> the data). I tried specifying file time either ascii or binary. same
> problem either way. I was wondering if the outputstream messes with
> the data, since it is in bytes. The application (being c++) writes
> and read in (char*).


I have seen things happen with binary files when using
ftpclient.retrieveFileStream/ftpclient.storeFileStream
and copying data manually.

Try using Util.copyStream to copy data.

Arne

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache's FTPClient class, anyone? Mikhail Teterin Java 4 02-19-2009 04:32 PM
Apache commons net 1.4.1 FTPClient reliability Christopher Benson-Manica Java 0 09-20-2007 10:04 PM
FTPClient Help Pradeep Java 2 08-26-2006 02:39 PM
FTPClient slow on laptops Barbara Vernaeve Java 0 11-18-2004 05:00 PM
sun.net.ftp.FtpClient Neeraj Vibhasrao Kulkarni Java 1 11-15-2004 10:39 PM



Advertisments