Solved

Ftp

Posted on 2001-06-26
4
217 Views
Last Modified: 2010-03-31
I am building an FTP Client Program using Java. It is working fine for text files. But for other documents it is not downloading properly.. Though ive set the type to I or A accordingly. I got this source from some site. It basically uses LineNumberReader for reading from the input stream.
I tried DataInputStream, it is very slow and once again not downloading the whole file.
Does anybody have any suggestions as to what kind of io streams that can be used..
Any help will be welcome...
Thank you
vg
0
Comment
Question by:vglaxmi2001
  • 2
4 Comments
 

Author Comment

by:vglaxmi2001
ID: 6227953
Ok. I have pasted the download section of my code here...
Hope somebody can help.


int data = 0;
FileWriter f = new FileWriter(file);
InputStreamReader BIN = new InputStreamReader( ds.getInputStream() );
DIN  = new LineNumberReader(BIN);
while((data = DIN.read()) != -1){
    f.write(data);
    f.flush();
}
f.close();


Thanks and regards
vg
0
 

Author Comment

by:vglaxmi2001
ID: 6229098
Well I have used plain InputStream instead of DataInputStream and it works fine with the Ftp server running on my system, but not with a remote server!!!!!!
The downloaded files are bigger now!!!!!!!
SOS.. Somebody Please help :-(
0
 
LVL 5

Expert Comment

by:vemul
ID: 7616584
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be deleted and points refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7639863
PAQ'd and points refunded

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question