001package com.box.sdk;
002
003import java.net.HttpURLConnection;
004import java.net.URL;
005
006/**
007 * Used to read HTTP responses containing redirect URLs in the 'LOCATION' header.
008 *
009 * <p>This request type extends BoxAPIResponse to provide additional functionality for handling redirect URLs.</p>
010 */
011public class BoxRedirectResponse extends BoxAPIResponse {
012
013    private URL redirectURL;
014
015    /**
016     * Constructs a BoxRedirectResponse without an associated HttpURLConnection.
017     */
018    public BoxRedirectResponse() {
019        super();
020    }
021
022    /**
023     * Constructs a BoxRedirectResponse using an HttpURLConnection.
024     *
025     * @param connection a connection that has already sent a request to the API.
026     */
027    public BoxRedirectResponse(HttpURLConnection connection) {
028        super(connection);
029    }
030
031    /**
032     * Gets the redirect URL for this response.
033     *
034     * @return redirectURL
035     */
036    public URL getRedirectURL() {
037        return this.redirectURL;
038    }
039
040    /**
041     * Sets the redirectURL for this response.
042     *
043     * @param redirectURL the redirect URL
044     */
045    public void setRedirectURL(URL redirectURL) {
046        this.redirectURL = redirectURL;
047    }
048
049}