Mantid
Loading...
Searching...
No Matches
CatalogDownloadDataFiles.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidICat/DllConfig.h"
14
15namespace Mantid {
16namespace ICat {
33class MANTID_ICAT_DLL CatalogDownloadDataFiles final : public API::Algorithm {
34public:
36 CatalogDownloadDataFiles() : API::Algorithm(), m_prog(0.0) {}
38 ~CatalogDownloadDataFiles() override = default;
40 const std::string name() const override { return "CatalogDownloadDataFiles"; }
42 const std::string summary() const override {
43 return "Downloads datafiles from the archives based on the ID of a "
44 "datafile.";
45 }
47 int version() const override { return 1; }
48 const std::vector<std::string> seeAlso() const override {
49 return {"DownloadFile", "CatalogGetDataFiles", "CatalogLogin"};
50 }
52 const std::string category() const override { return "DataHandling\\Catalog"; }
53
63 std::string testDownload(const std::string &URL, const std::string &fileName);
64
65private:
67 void init() override;
69 void exec() override;
71 bool isDataFile(const std::string &fileName);
73 std::string saveFiletoDisk(std::istream &rs, const std::string &fileName);
75 std::string doDownloadandSavetoLocalDrive(const std::string &URL, const std::string &fileName);
76
77private:
79 double m_prog;
80};
81} // namespace ICat
82} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
CatalogDownloadDataFiles is responsible for downloading datafiles from a catalog.
~CatalogDownloadDataFiles() override=default
Destructor.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
int version() const override
Algorithm's version for identification overriding a virtual method.
Helper class which provides the Collimation Length for SANS instruments.