Package enterprises.iwakura.amber
Class StringDownloadResult
java.lang.Object
enterprises.iwakura.amber.DownloadResult
enterprises.iwakura.amber.StringDownloadResult
Extends
DownloadResult to include the downloaded content as a String.-
Constructor Summary
ConstructorsConstructorDescriptionStringDownloadResult(boolean success, String content, String errorMessage) Creates a new StringDownloadResult. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDownloadResultCreates a StringDownloadResult representing a failed download with the provided error message.static StringDownloadResultCreates a StringDownloadResult representing a successful download with the provided content.Methods inherited from class enterprises.iwakura.amber.DownloadResult
success
-
Constructor Details
-
StringDownloadResult
Creates a new StringDownloadResult.- Parameters:
success- whether the download was successfulcontent- the downloaded content as a String, or null if the download failederrorMessage- the error message if the download failed, or null if the download was successful
-
-
Method Details
-
error
Creates a StringDownloadResult representing a failed download with the provided error message.- Parameters:
errorMessage- the error message describing the failure- Returns:
- a StringDownloadResult indicating failure
-
success
Creates a StringDownloadResult representing a successful download with the provided content.- Parameters:
content- the downloaded content as a String- Returns:
- a StringDownloadResult indicating success
-