Topic: 关于制作一个“下载软件”程序的问题。 |
Print this page |
1.关于制作一个“下载软件”程序的问题。 | Copy to clipboard |
Posted by: caoyi Posted on: 2004-02-12 11:44 我想自己编写一个“下载软件”程序来锻炼自己的JAVA能力。但是对于这个程序的了解并不是非常透彻。不是很清楚该是用什么类加以实现。也不太清楚HTTP方面的知识,以及如何从网络上下载文件。 我在IBM 的JAVA开发专区中找大到一篇关于利用JAVA实现断点续传的程序。 http://www-900.ibm.com/developerWorks/cn/java/joy-down/index.shtml 觉得JDK里面应该使用这几个提供到的类。 class: URL HttpURLConnection InputStream RandomAccessFile DataOutputStream File DataInputStream 不知道又没有遗漏。还有在编写这个程序时候还应该考虑什么问题。谢谢。 |
2.Re:关于制作一个“下载软件”程序的问题。 [Re: caoyi] | Copy to clipboard |
Posted by: floater Posted on: 2004-02-13 05:55 1. Read HTTP/FTP specs 2. If you don't have extensive experience on programming, start with something small, just like the reference you mentioned, but just a single thread. Make it work, then expand it out. 3. If you do believe you are good enough, looks at the ftp tools available on the net, like cuteftp, leapftp, flashftp, ... see what kind of features they have and you may think about how they do it. There are features like multi protocols, firewall/proxy settings, transfer types, resumed downloading, etc. 4. In the reference above, the coding is very primitive in the following(it's pretty old): a. FileAccessI class shouldn't implement Serializable at all, not point to do so. b. did not seperate local disk writing from net downloading code. c. should seperate out the thread handling from the rest. d. I don't see the point why SiteFileFetch needs to inherit from Thread, either from coding or requirements. e. HttpURLConnection and URLConnection have better ways to deal with headers, and others. |
3.Re:关于制作一个“下载软件”程序的问题。 [Re: caoyi] | Copy to clipboard |
Posted by: caoyi Posted on: 2004-02-14 15:09 谢谢版主大人的提示。 我想我可能已经明白你说得,以及我该作什么了。 再次感谢! |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |