gecko/mobile/android/base/sync/net/BaseResourceDelegate.java
Richard Newman ab9b34d533 Merge m-c to s-c (including fixed conflict in Android Sync manifest).
--HG--
rename : mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_button.xml.in => mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_button.xml
rename : mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_level.xml.in => mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_level.xml
rename : mobile/android/base/resources/drawable/tabs_button.xml.in => mobile/android/base/resources/drawable/tabs_button.xml
rename : mobile/android/base/resources/drawable/tabs_level.xml.in => mobile/android/base/resources/drawable/tabs_level.xml
2012-12-15 17:08:14 -08:00

45 lines
1.2 KiB
Java

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.sync.net;
import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase;
import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient;
/**
* Shared abstract class for resource delegate that use the same timeouts
* and no credentials.
*
* @author rnewman
*
*/
public abstract class BaseResourceDelegate implements ResourceDelegate {
public static int connectionTimeoutInMillis = 1000 * 30; // Wait 30s for a connection to open.
public static int socketTimeoutInMillis = 1000 * 2 * 60; // Wait 2 minutes for data.
protected Resource resource;
public BaseResourceDelegate(Resource resource) {
this.resource = resource;
}
@Override
public int connectionTimeout() {
return connectionTimeoutInMillis;
}
@Override
public int socketTimeout() {
return socketTimeoutInMillis;
}
@Override
public AuthHeaderProvider getAuthHeaderProvider() {
return null;
}
@Override
public void addHeaders(HttpRequestBase request, DefaultHttpClient client) {
}
}