Refactoring:
* renamed VideoInfoItem to VideoPreviewInfo * moved streaming service-related classes into their own, new package services * added javadoc to some classes and methods (where functionality is known well enough to explain) * De-duplicated common fields between VideoInfo and VideoPreviewInfo by moving them into a common superclass: AbstractVideoInfo * Removed 2 methods which only call super(), and therefore are unnecessary: PlayVideoActivity.onResume() and PlayVideoActivity.onPostCreate(Bundle)
This commit is contained in:
parent
975a3e8103
commit
320a4e2351
19 changed files with 136 additions and 108 deletions
|
|
@ -31,6 +31,11 @@ public class Downloader {
|
|||
|
||||
private static final String USER_AGENT = "Mozilla/5.0";
|
||||
|
||||
/**Download the text file at the supplied URL as in download(String),
|
||||
* but set the HTTP header field "Accept-Language" to the supplied string.
|
||||
* @param siteUrl the URL of the text file to return the contents of
|
||||
* @param language the language (usually a 2-character code) to set as the preferred language
|
||||
* @return the contents of the specified text file*/
|
||||
public static String download(String siteUrl, String language) {
|
||||
String ret = "";
|
||||
try {
|
||||
|
|
@ -44,7 +49,7 @@ public class Downloader {
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**Common functionality between download(String url) and download(String url, String language)*/
|
||||
private static String dl(HttpURLConnection con) {
|
||||
StringBuffer response = new StringBuffer();
|
||||
|
||||
|
|
@ -72,7 +77,10 @@ public class Downloader {
|
|||
return response.toString();
|
||||
}
|
||||
|
||||
|
||||
/**Download (via HTTP) the text file located at the supplied URL, and return its contents.
|
||||
* Primarily intended for downloading web pages.
|
||||
* @param siteUrl the URL of the text file to download
|
||||
* @return the contents of the specified text file*/
|
||||
public static String download(String siteUrl) {
|
||||
String ret = "";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue