apache FTPClient

Discussion in 'Java' started by Bricker, M., Feb 12, 2009.

  1. Bricker,  M.

    Bricker, M. Guest

    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.
    Bricker, M., Feb 12, 2009
    #1
    1. Advertising

  2. Bricker,  M.

    Lew Guest

    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
    Lew, Feb 13, 2009
    #2
    1. Advertising

  3. Bricker,  M.

    Arne Vajhøj Guest

    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
    Arne Vajhøj, Feb 13, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neeraj Vibhasrao Kulkarni

    sun.net.ftp.FtpClient

    Neeraj Vibhasrao Kulkarni, Nov 15, 2004, in forum: Java
    Replies:
    1
    Views:
    14,379
    A. Bolmarcich
    Nov 15, 2004
  2. Barbara Vernaeve

    FTPClient slow on laptops

    Barbara Vernaeve, Nov 18, 2004, in forum: Java
    Replies:
    0
    Views:
    589
    Barbara Vernaeve
    Nov 18, 2004
  3. Pradeep

    FTPClient Help

    Pradeep, Aug 16, 2006, in forum: Java
    Replies:
    2
    Views:
    517
  4. Christopher Benson-Manica

    Apache commons net 1.4.1 FTPClient reliability

    Christopher Benson-Manica, Sep 20, 2007, in forum: Java
    Replies:
    0
    Views:
    493
    Christopher Benson-Manica
    Sep 20, 2007
  5. Mikhail Teterin

    Apache's FTPClient class, anyone?

    Mikhail Teterin, Feb 11, 2008, in forum: Java
    Replies:
    4
    Views:
    4,038
    symphonyx
    Feb 19, 2009
Loading...

Share This Page