Fix broken download link due to moved URL functions

This commit is contained in:
timvisee 2018-04-09 21:49:55 +02:00
parent 6e913428c2
commit 1f516d0dcb
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2

View file

@ -1,6 +1,7 @@
extern crate chrono;
extern crate regex;
use api::url::UrlBuilder;
use url::{
ParseError as UrlParseError,
Url,
@ -174,6 +175,13 @@ impl RemoteFile {
pub fn set_owner_token(&mut self, token: Option<String>) {
self.owner_token = token;
}
/// Build the download URL of the given file.
/// This URL is identical to the share URL, a term used in this API.
/// Set `secret` to `true`, to include it in the URL if known.
pub fn download_url(&self, secret: bool) -> Url {
UrlBuilder::download(&self, secret)
}
}
#[derive(Debug, Fail)]