diff options
Diffstat (limited to 'src/com/android/exchange/EasResponse.java')
-rw-r--r-- | src/com/android/exchange/EasResponse.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/exchange/EasResponse.java b/src/com/android/exchange/EasResponse.java index 5af80fdd..4a5035a2 100644 --- a/src/com/android/exchange/EasResponse.java +++ b/src/com/android/exchange/EasResponse.java @@ -135,6 +135,15 @@ public class EasResponse { } /** + * Returns the redirect address from this response in {@link Uri} form or {@code null} if the + * location field is missing from the header. + */ + public Uri getRedirectUri() { + final Header locHeader = getHeader("Location"); + return locHeader != null ? Uri.parse(locHeader.getValue()) : null; + } + + /** * Return an appropriate input stream for the response, either a GZIPInputStream, for * compressed data, or a generic InputStream otherwise * @return the input stream for the response @@ -203,4 +212,4 @@ public class EasResponse { mClosed = true; } } -}
\ No newline at end of file +} |