Fix broken download link due to moved URL functions
This commit is contained in:
parent
6e913428c2
commit
1f516d0dcb
1 changed files with 8 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue