Changeset 641 for AE/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Jan 21, 2013, 12:14:52 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/backend
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/depot/DepotManager.java
r635 r641 27 27 28 28 import org.apache.http.HttpResponse; 29 import org.apache.http.client.methods.Http Get;29 import org.apache.http.client.methods.HttpHead; 30 30 import org.apache.http.client.methods.HttpRequestBase; 31 31 import org.apache.http.impl.client.DefaultHttpClient; … … 196 196 try { 197 197 DefaultHttpClient httpclient = new DefaultHttpClient(); 198 httpQuery = new Http Get(DepotConfig.getDepotUrl());198 httpQuery = new HttpHead(DepotConfig.getDepotUrl()); 199 199 200 200 HttpResponse response = httpclient.execute(httpQuery); -
AE/installer2/src/net/oni2/aeinstaller/backend/network/FileDownloader.java
r634 r641 48 48 private URL url = null; 49 49 private File target = null; 50 private int size = -1;50 private int fileLength = Integer.MAX_VALUE; 51 51 private int downloaded = 0; 52 52 … … 64 64 this.url = new URL(url); 65 65 this.target = target; 66 67 URLConnection connection = this.url.openConnection();68 connection.connect();69 size = connection.getContentLength();70 66 } 71 67 … … 94 90 t.start(); 95 91 state = EState.RUNNING; 96 updateStatus(downloaded, size);97 92 } 98 93 } … … 108 103 else 109 104 state = EState.RUNNING; 110 updateStatus(downloaded, size);105 updateStatus(downloaded, fileLength); 111 106 } 112 107 } … … 149 144 public void run() { 150 145 int downloaded = 0; 151 int fileLength = Integer.MAX_VALUE;152 146 String strLastModified = null; 153 147 String strEtag = null; … … 181 175 try { 182 176 URLConnection connection = url.openConnection(); 177 connection.setRequestProperty("Cache-Control", "no-cache"); 183 178 if (downloaded == 0) { 184 179 connection.connect(); … … 257 252 258 253 /** 259 * @return the size260 */261 public int getSize() {262 return size;263 }264 265 /**266 254 * @return the downloaded size 267 255 */
Note:
See TracChangeset
for help on using the changeset viewer.