Android Open Source - PatternAndroid Connection Exception






From Project

Back to project page PatternAndroid.

License

The source code is released under:

MIT License

If you think the Android project PatternAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * 2011 Foxykeep (http://datadroid.foxykeep.com)
 * <p>//from   w w w.j av  a  2 s  .c  o m
 * Licensed under the Beerware License : <br />
 * As long as you retain this notice you can do whatever you want with this stuff. If we meet some
 * day, and you think this stuff is worth it, you can buy me a beer in return
 */

package com.foxykeep.datadroid.exception;

/**
 * Thrown to indicate that a connection error occurred.
 *
 * @author Foxykeep
 */
public final class ConnectionException extends Exception {

    private static final long serialVersionUID = 4658308128254827562L;

    private String mRedirectionUrl;
    private int mStatusCode = -1;

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace.
     */
    public ConnectionException() {
        super();
    }

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace, the
     * specified detail message and the specified cause.
     *
     * @param detailMessage The detail message for this exception.
     * @param throwable The cause of this exception.
     */
    public ConnectionException(final String detailMessage, final Throwable throwable) {
        super(detailMessage, throwable);
    }

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace and the
     * specified detail message.
     *
     * @param detailMessage The detail message for this exception.
     */
    public ConnectionException(final String detailMessage) {
        super(detailMessage);
    }

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace and the
     * specified detail message.
     *
     * @param detailMessage The detail message for this exception.
     * @param redirectionUrl The redirection URL.
     */
    public ConnectionException(final String detailMessage, final String redirectionUrl) {
        super(detailMessage);
        mRedirectionUrl = redirectionUrl;
        mStatusCode = 301;
    }

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace and the
     * specified detail message and the error status code
     *
     * @param detailMessage The detail message for this exception.
     * @param statusCode The HTTP status code
     */
    public ConnectionException(final String detailMessage, final int statusCode) {
        super(detailMessage);
        mStatusCode = statusCode;
    }

    /**
     * Constructs a new {@link ConnectionException} that includes the current stack trace and the
     * specified cause.
     *
     * @param throwable The cause of this exception.
     */
    public ConnectionException(final Throwable throwable) {
        super(throwable);
    }

    public String getRedirectionUrl() {
        return mRedirectionUrl;
    }

    public int getStatusCode() {
        return mStatusCode;
    }

}




Java Source Code List

android.support.util.Base64.java
android.support.util.LruCache.java
com.foxykeep.datadroid.exception.ConnectionException.java
com.foxykeep.datadroid.exception.CustomRequestException.java
com.foxykeep.datadroid.exception.DataException.java
com.foxykeep.datadroid.internal.network.NetworkConnectionImpl.java
com.foxykeep.datadroid.network.NetworkConnection.java
com.foxykeep.datadroid.network.UserAgentUtils.java
com.foxykeep.datadroid.requestmanager.RequestManager.java
com.foxykeep.datadroid.requestmanager.Request.java
com.foxykeep.datadroid.service.MultiThreadedIntentService.java
com.foxykeep.datadroid.service.RequestService.java
com.foxykeep.datadroid.util.DataDroidLog.java
com.foxykeep.datadroid.util.ObjectUtils.java
com.handmark.pulltorefresh.library.ILoadingLayout.java
com.handmark.pulltorefresh.library.IPullToRefresh.java
com.handmark.pulltorefresh.library.LoadingLayoutProxy.java
com.handmark.pulltorefresh.library.OverscrollHelper.java
com.handmark.pulltorefresh.library.PullToRefreshAdapterViewBase.java
com.handmark.pulltorefresh.library.PullToRefreshBase.java
com.handmark.pulltorefresh.library.PullToRefreshExpandableListView.java
com.handmark.pulltorefresh.library.PullToRefreshGridView.java
com.handmark.pulltorefresh.library.PullToRefreshHorizontalScrollView.java
com.handmark.pulltorefresh.library.PullToRefreshListView.java
com.handmark.pulltorefresh.library.PullToRefreshScrollView.java
com.handmark.pulltorefresh.library.PullToRefreshWebView.java
com.handmark.pulltorefresh.library.extras.PullToRefreshWebView2.java
com.handmark.pulltorefresh.library.extras.SoundPullEventListener.java
com.handmark.pulltorefresh.library.internal.EmptyViewMethodAccessor.java
com.handmark.pulltorefresh.library.internal.FlipLoadingLayout.java
com.handmark.pulltorefresh.library.internal.IndicatorLayout.java
com.handmark.pulltorefresh.library.internal.LoadingLayout.java
com.handmark.pulltorefresh.library.internal.RotateLoadingLayout.java
com.handmark.pulltorefresh.library.internal.Utils.java
com.handmark.pulltorefresh.library.internal.ViewCompat.java
com.twitterclone.model.RequestFactory.java
com.twitterclone.model.RestRequestManager.java
com.twitterclone.model.operations.RestTwitter.java
com.twitterclone.model.operations.TweetsOperation.java
com.twitterclone.model.provider.Contract.java
com.twitterclone.model.provider.RestProvider.java
com.twitterclone.model.service.RestService.java
com.twitterclone.ui.MainActivity.java