java中http断点续传的原理(2)Java认证考试
文章作者 100test 发表时间 2010:01:01 15:52:27
来源 100Test.Com百考试题网
//获得文件长度
public long getFileSize()
{
int nFileLength = -1.
try{
URL url = new URL(siteInfoBean.getSSiteURL()).
HttpURLConnection httpConnection = (HttpURLConnection)url.openConnection ().
httpConnection.setRequestProperty("User-Agent","NetFox").
int responseCode=httpConnection.getResponseCode().
if(responseCode