FileDocCategorySizeDatePackage
UrlInterceptRegistry.javaAPI DocAndroid 5.1 API5209Thu Mar 12 22:22:10 GMT 2015android.webkit

UrlInterceptRegistry

public final class UrlInterceptRegistry extends Object
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

Fields Summary
private static final String
LOGTAG
private static boolean
mDisabled
private static LinkedList
mHandlerList
Constructors Summary
Methods Summary
private static synchronized java.util.LinkedListgetHandlers()


         
        if(mHandlerList == null)
            mHandlerList = new LinkedList<UrlInterceptHandler>();
        return mHandlerList;
    
public static synchronized android.webkit.PluginDatagetPluginData(java.lang.String url, java.util.Map headers)
Given an url, returns the PluginData of the first UrlInterceptHandler interested, or null if none are or if intercepts are disabled.

return
A PluginData instance containing surrogate content.
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        if (urlInterceptDisabled()) {
            return null;
        }
        Iterator iter = getHandlers().listIterator();
        while (iter.hasNext()) {
            UrlInterceptHandler handler = (UrlInterceptHandler) iter.next();
            PluginData data = handler.getPluginData(url, headers);
            if (data != null) {
                return data;
            }
        }
        return null;
    
public static synchronized android.webkit.CacheManager.CacheResultgetSurrogate(java.lang.String url, java.util.Map headers)
Given an url, returns the CacheResult of the first UrlInterceptHandler interested, or null if none are.

return
A CacheResult containing surrogate content.
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        if (urlInterceptDisabled()) {
            return null;
        }
        Iterator iter = getHandlers().listIterator();
        while (iter.hasNext()) {
            UrlInterceptHandler handler = (UrlInterceptHandler) iter.next();
            CacheResult result = handler.service(url, headers);
            if (result != null) {
                return result;
            }
        }
        return null;
    
public static synchronized booleanregisterHandler(android.webkit.UrlInterceptHandler handler)
Register a new UrlInterceptHandler. This handler will be called before any that were previously registered.

param
handler The new UrlInterceptHandler object
return
true if the handler was not previously registered.
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        if (!getHandlers().contains(handler)) {
            getHandlers().addFirst(handler);
            return true;
        } else {
            return false;
        }
    
public static synchronized voidsetUrlInterceptDisabled(boolean disabled)
set the flag to control whether url intercept is enabled or disabled

param
disabled true to disable the cache
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        mDisabled = disabled;
    
public static synchronized booleanunregisterHandler(android.webkit.UrlInterceptHandler handler)
Unregister a previously registered UrlInterceptHandler.

param
handler A previously registered UrlInterceptHandler.
return
true if the handler was found and removed from the list.
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        return getHandlers().remove(handler);
    
public static synchronized booleanurlInterceptDisabled()
get the state of the url intercept, enabled or disabled

return
return if it is disabled
hide
deprecated
This class was intended to be used by Gears. Since Gears was deprecated, so is this class.

        return mDisabled;