Class ICSDownloader
java.lang.Object
com.nicholasalfonso.lato.integration.ICSDownloader
HTTP client utility for downloading and validating remote iCalendar feeds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadFeed(String url) Downloads an iCalendar feed as an input stream.Downloads an iCalendar feed and returns its content as a string.booleanvalidateUrl(String url) Validates that a URL points to a reachable iCalendar feed.
-
Constructor Details
-
ICSDownloader
public ICSDownloader()
-
-
Method Details
-
downloadFeed
Downloads an iCalendar feed as an input stream.- Parameters:
url- the feed URL to download- Returns:
- input stream containing the feed body
- Throws:
IOException- if the HTTP request failsInterruptedException- if the HTTP request is interrupted
-
validateUrl
Validates that a URL points to a reachable iCalendar feed.- Parameters:
url- the feed URL to validate- Returns:
trueif the URL is valid and returns iCalendar content
-
downloadFeedAsString
Downloads an iCalendar feed and returns its content as a string.- Parameters:
url- the feed URL to download- Returns:
- the feed body as a string
- Throws:
IOException- if the HTTP request failsInterruptedException- if the HTTP request is interrupted
-