12#include "MantidAPI/DllConfig.h"
102 : m_systemError(
""), m_userInfo(info), m_filepath(
""){};
104 ScriptRepoException(
const std::string &info,
const std::string &system,
const std::string &file = std::string(),
108 const char *what() const noexcept override;
112 const
std::
string &systemError()
const {
return m_systemError; };
114 const std::string &
filePath()
const {
return m_filepath; };
321 virtual const std::string &
description(
const std::string &path) = 0;
389 virtual void download(
const std::string &file_path) = 0;
423 virtual void install(
const std::string &local_path) = 0;
436 virtual void connect(
const std::string &webserverurl =
"") = 0;
503 virtual void upload(
const std::string &file_path,
const std::string &comment,
const std::string &author,
504 const std::string &email) = 0;
538 virtual void remove(
const std::string &file_path,
const std::string &comment,
const std::string &author,
539 const std::string &email) = 0;
The ScriptRepository class is intended to be used mainly by the users, who will be willing to share a...
std::string m_systemError
The message returned by what()
const std::string & filePath() const
Returns the file and position where the error was caused.
ScriptRepoException(const std::string &info=std::string("Unknown Exception"))
default constructor
virtual void setIgnorePatterns(const std::string &patterns)=0
Define the file patterns that will not be listed in listFiles.
virtual bool isValid()=0
Check if the local repository exists.
virtual int setAutoUpdate(const std::string &path, bool option=true)=0
Define the AutoUpdate option, which define if a file will be updated as soon as new versions are avai...
virtual void remove(const std::string &file_path, const std::string &comment, const std::string &author, const std::string &email)=0
Delete the file from the remote repository (it does not touch the local copy).
virtual void install(const std::string &local_path)=0
Install the necessary resources at the local_path given that allows the ScriptRepository to operate l...
virtual const std::string & description(const std::string &path)=0
Provide the description of the file given the path.
virtual std::string ignorePatterns()=0
Return the ignore patters that was defined through ScriptRepository::setIgnorePatterns.
virtual void upload(const std::string &file_path, const std::string &comment, const std::string &author, const std::string &email)=0
Upload the local file/folder to be available at the remote repository.
virtual SCRIPTSTATUS fileStatus(const std::string &file_path)=0
Return the status of the file, according to the status defined in Mantid::API::SCRIPTSTATUS.
virtual ScriptInfo info(const std::string &path)=0
Return the information about the script through the Mantid::API::ScriptInfo struct.
virtual std::vector< std::string > listFiles()=0
Return the list of files inside the repository.
virtual void download(const std::string &file_path)=0
Create a copy of the remote file/folder inside the local repository.
virtual void connect(const std::string &webserverurl="")=0
Allow the ScriptRepository to double check the connection with the web server.
virtual std::vector< std::string > check4Update()=0
Connects to the remote repository checking for updates.
ScriptInfo fileInfo(const std::string &path)
virtual ~ScriptRepository()=default
Virtual destructor (always needed for abstract classes)
std::shared_ptr< ScriptRepository > ScriptRepository_sptr
shared pointer to the function base class
SCRIPTSTATUS
Represent the possible states for a given file:
Helper class which provides the Collimation Length for SANS instruments.
Information about the files inside the repository.
Types::Core::DateAndTime pub_date
Time of the last update of this file (remotelly)
bool auto_update
Marked for auto update.
std::string author
Identification of the author of the script.
bool directory
Directory Flag to indicate if the entry is a directory.