15#include "boost/algorithm/string/predicate.hpp"
16#include "boost/make_shared.hpp"
62 "The filename to save the download to.");
70 if ((!boost::starts_with(address,
"http://")) && (!boost::starts_with(address,
"https://"))) {
71 address =
"http://" + address;
73 "assumed to continue: " +
78 Poco::URI url(address);
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A specialized class for dealing with file properties.
@ Save
to specify a file to write to, the file may or may not exist
DownloadFile : Downloads a file from a url to the file system.
void exec() override
Execute the algorithm.
Kernel::InternetHelper * m_internetHelper
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
const std::string name() const override
Algorithms name for identification.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
virtual ~DownloadFile() override
Destructor.
void init() override
Initialize the algorithm's properties.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
InternetHelper : A helper class for supporting access to resources through HTTP and HTTPS.
virtual HTTPStatus downloadFile(const std::string &urlFile, const std::string &localFilePath="")
Download a url and fetch it inside the local path given.
ListValidator is a validator that requires the value of a property to be one of a defined list of pos...
void information(const std::string &msg)
Logs at information level.
Validator to check that a property is not left empty.
Describes the direction (within an algorithm) of a Property.
@ InOut
Both an input & output workspace.