LogicalFileSystem.h
75 throw std::runtime_error("LogicalFileSystem::assertInitHasBeenCalled(): A logical file system needs to be initialized before it's been called");
80 throw std::invalid_argument("LogicalFileSystem::assertDirectoryExists(): directory " + absolute_path + " does not exist");
86 throw std::invalid_argument("LogicalFileSystem::assertDirectoryExists(): directory " + absolute_path + " already exists");
93 throw std::invalid_argument("LogicalFileSystem::assertDirectoryIsEmpty(): directory " + absolute_path + "is not empty");
100 throw std::invalid_argument("LogicalFileSystem::assertFileIsInDirectory(): File " + file->getID() +
void createDirectory(std::string absolute_path)
Create a new directory.
Definition: LogicalFileSystem.cpp:70
void init()
Initializes the Logical File System (must be called before any other operation on this file system) ...
Definition: LogicalFileSystem.cpp:50
std::set< WorkflowFile * > listFilesInDirectory(std::string absolute_path)
Get the files in a directory as a set.
Definition: LogicalFileSystem.cpp:192
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
LogicalFileSystem(std::string hostname, std::string ss_name, std::string mount_point)
Constructor.
Definition: LogicalFileSystem.cpp:26
bool hasEnoughFreeSpace(double bytes)
Checks whether there is enough space to store some number of bytes.
Definition: LogicalFileSystem.cpp:212
bool isDirectoryEmpty(std::string absolute_path)
Checks whether a directory is empty.
Definition: LogicalFileSystem.cpp:94
void reserveSpace(WorkflowFile *file, std::string absolute_path)
Reserve space for a file that will be stored.
Definition: LogicalFileSystem.cpp:232
double getTotalCapacity()
Get the total capacity.
Definition: LogicalFileSystem.cpp:202
void removeEmptyDirectory(std::string absolute_path)
Remove an empty directory.
Definition: LogicalFileSystem.cpp:107
bool isFileInDirectory(WorkflowFile *file, std::string absolute_path)
Checks whether a file is in a directory.
Definition: LogicalFileSystem.cpp:174
void storeFileInDirectory(WorkflowFile *file, std::string absolute_path)
Store file in directory.
Definition: LogicalFileSystem.cpp:122
void removeFileFromDirectory(WorkflowFile *file, std::string absolute_path)
Remove a file in a directory.
Definition: LogicalFileSystem.cpp:145
void unreserveSpace(WorkflowFile *file, std::string absolute_path)
Unreserve space that was saved for a file (likely a failed transfer)
Definition: LogicalFileSystem.cpp:254
A class that implements a weak file system abstraction.
Definition: LogicalFileSystem.h:29
void removeAllFilesInDirectory(std::string absolute_path)
Remove all files in a directory.
Definition: LogicalFileSystem.cpp:159
Definition: Alarm.cpp:19
bool doesDirectoryExist(std::string absolute_path)
Checks whether a directory exists.
Definition: LogicalFileSystem.cpp:82
double getFreeSpace()
Get the file system's free space.
Definition: LogicalFileSystem.cpp:221