@@ -58,7 +58,7 @@ public synchronized int length() throws ProxyCacheException {
5858 @ Override
5959 public void open (int offset ) throws ProxyCacheException {
6060 try {
61- connection = openConnection (offset , "GET" , -1 );
61+ connection = openConnection (offset , -1 );
6262 mime = connection .getContentType ();
6363 inputStream = new BufferedInputStream (connection .getInputStream (), DEFAULT_BUFFER_SIZE );
6464 length = readSourceAvailableBytes (connection , offset , connection .getResponseCode ());
@@ -99,7 +99,7 @@ private void fetchContentInfo() throws ProxyCacheException {
9999 HttpURLConnection urlConnection = null ;
100100 InputStream inputStream = null ;
101101 try {
102- urlConnection = openConnection (0 , "HEAD" , 10000 );
102+ urlConnection = openConnection (0 , 10000 );
103103 length = urlConnection .getContentLength ();
104104 mime = urlConnection .getContentType ();
105105 inputStream = urlConnection .getInputStream ();
@@ -114,15 +114,14 @@ private void fetchContentInfo() throws ProxyCacheException {
114114 }
115115 }
116116
117- private HttpURLConnection openConnection (int offset , String method , int timeout ) throws IOException , ProxyCacheException {
117+ private HttpURLConnection openConnection (int offset , int timeout ) throws IOException , ProxyCacheException {
118118 HttpURLConnection connection ;
119119 boolean redirected ;
120120 int redirectCount = 0 ;
121121 String url = this .url ;
122122 do {
123123 Log .d (LOG_TAG , "Open connection " + (offset > 0 ? " with offset " + offset : "" ) + " to " + url );
124124 connection = (HttpURLConnection ) new URL (url ).openConnection ();
125- connection .setRequestMethod (method );
126125 if (offset > 0 ) {
127126 connection .setRequestProperty ("Range" , "bytes=" + offset + "-" );
128127 }
0 commit comments