Class UrlRequestResult
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.resources.initializer.UrlRequestResult
-
class UrlRequestResult extends java.lang.ObjectThis class stores some result details such as response code, HTTP header field "Location", last modified and content length of a url request.
-
-
Field Summary
Fields Modifier and Type Field Description private longcontentLengthprivate longlastModifiedprivate java.net.URLlocationprivate intresponseCodeprivate java.net.URLurlprivate VersionIdversion
-
Constructor Summary
Constructors Constructor Description UrlRequestResult(java.net.URL url, int responseCode, java.net.URL location, VersionId version, long lastModified, long contentLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) longgetContentLength()longgetLastModified()(package private) java.net.URLgetLocation()(package private) intgetResponseCode()(package private) java.net.URLgetUrl()(package private) VersionIdgetVersion()(package private) booleanisRedirect()private static booleanisRedirectResponseCode(int responseCode)booleanisSuccess()java.lang.StringtoString()
-
-
-
Field Detail
-
url
private final java.net.URL url
-
responseCode
private final int responseCode
-
location
private final java.net.URL location
-
version
private final VersionId version
-
lastModified
private final long lastModified
-
contentLength
private final long contentLength
-
-
Constructor Detail
-
UrlRequestResult
UrlRequestResult(java.net.URL url, int responseCode, java.net.URL location, VersionId version, long lastModified, long contentLength)
-
-
Method Detail
-
getUrl
java.net.URL getUrl()
-
getLocation
java.net.URL getLocation()
-
getVersion
VersionId getVersion()
-
getResponseCode
int getResponseCode()
-
getContentLength
long getContentLength()
-
getLastModified
public long getLastModified()
-
isRedirect
boolean isRedirect()
- Returns:
- whether this
UrlRequestResultrepresents a valid redirect with a location and a redirect result code (one of 301-303 or 307-308)
-
isRedirectResponseCode
private static boolean isRedirectResponseCode(int responseCode)
- Returns:
- whether this
UrlRequestResultcontains a redirect result code (one of 301-303 or 307-308)
-
isSuccess
public boolean isSuccess()
- Returns:
- whether the return code is a success
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-