Package Torello.HTML.Tools.NewsSite
Enum DownloadResult
- java.lang.Object
-
- java.lang.Enum<DownloadResult>
-
- Torello.HTML.Tools.NewsSite.DownloadResult
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DownloadResult>
public enum DownloadResult extends java.lang.Enum<DownloadResult>
An enumeration of the various problem that could potentially flare up when downloading news article HTML.
This enumerated type is used by theclass ScrapeArticles
as a return-value. The different constants below are explained in the comments section of each constant. Only the constant named'SUCCESS'
indicates that a newsclass 'Article'
was both successfully downloaded and also handled / saved by the'ScrapedArticleReceiver'
instance. All other constants are used to indicate something went wrong during either the download process or when attempting to save theArticle
.
Hi-Lited Source-Code:- View Here: Torello/HTML/Tools/NewsSite/DownloadResult.java
- Open New Browser-Tab: Torello/HTML/Tools/NewsSite/DownloadResult.java
File Size: 1,776 Bytes Line Count: 48 '\n' Characters Found
-
-
Enum Constant Summary
-
Method Summary
Convert String to Enum Constant Modifier and Type Method static DownloadResult
valueOf(String name)
List all Enum Constants Modifier and Type Method static DownloadResult[]
values()
-
-
-
Enum Constant Detail
-
SUCCESS
public static final DownloadResult SUCCESS
The news-article was successfully downloaded.
-
BAD_ARTICLE_URL
public static final DownloadResult BAD_ARTICLE_URL
The article'sURL
could not be instantiated, because theURL
constructor threw an exception.
-
COULD_NOT_DOWNLOAD
public static final DownloadResult COULD_NOT_DOWNLOAD
The HTTP-Download Connection failed.
-
EMPTY_PAGE_VECTOR
public static final DownloadResult EMPTY_PAGE_VECTOR
The HTTP-Download Returned an emptyVector
.
-
ARTICLE_GET_EXCEPTION
public static final DownloadResult ARTICLE_GET_EXCEPTION
There was an "Article Get Exception" (Review the log for more details).
-
ARTICLE_GET_RETURNED_NULL
public static final DownloadResult ARTICLE_GET_RETURNED_NULL
TheArticleGet
returned a nullVector<HTMLNode>
.
-
ARTICLE_GET_RETURNED_EMPTY_VECTOR
public static final DownloadResult ARTICLE_GET_RETURNED_EMPTY_VECTOR
TheArticleGet
returned an emptyVector<HTMLNode>
.
-
NO_IMAGES_FOUND
public static final DownloadResult NO_IMAGES_FOUND
There were no images found, and "only articles with images" was requested.
-
NO_IMAGES_FOUND_ONLY_BANNERS
public static final DownloadResult NO_IMAGES_FOUND_ONLY_BANNERS
There were only banner images, but no real images.
-
UNKNOWN_EXCEPTION
public static final DownloadResult UNKNOWN_EXCEPTION
There was an unknown exception. Review the log for more details.
-
-
Method Detail
-
values
public static DownloadResult[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DownloadResult c : DownloadResult.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DownloadResult valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-