Esempio n. 1
0
    def modified_time(self, path):
        """
        Get the last time the data of file system object was modified.

        :param path: The path to operate on.
        :return: The time stamp, as a float.
        """
        raise OperationNotSupportedError()
Esempio n. 2
0
    def size(self, path):
        """
        Get the size of the file.

        :param path: The path to operate on.
        :return: The size in bytes.
        """
        raise OperationNotSupportedError()
Esempio n. 3
0
    def rename(self, path, new_name):
        """
        Rename a file object.

        :param path: The path to be operated on.
        :param new_name: The new name of the file object, as as string.
        :return: None
        """
        raise OperationNotSupportedError()
Esempio n. 4
0
    def list(self, path, pattern='*'):
        """
        Return a list of the names of the files and directories appearing in this folder.

        :param path: The path to operate on.
        :param pattern: A glob-style pattern against which names must match.
        :return: A list of matching file and directory names.
        """
        raise OperationNotSupportedError()
Esempio n. 5
0
    def load_config_value(cls, manager, value, *args, **kwargs):
        """
        Load a class instance from the value of a config option.

        :param manager: A ConfigManager instance.
        :param value: The string value of the option.
        :return: A new instance of this class.
        """
        raise OperationNotSupportedError()
Esempio n. 6
0
    def remove(self, path):
        """
        Remove the folder or file.

        :param path: The path to operate on.
        """
        assert self.is_open
        path = self.check_path(path)

        if self.is_dir(path):
            raise OperationNotSupportedError()
        else:
            response = requests.delete(self._get_url(path))
            response.raise_for_status()
Esempio n. 7
0
    def make_dir(self,
                 path,
                 overwrite=False,
                 clear=False,
                 fill=True,
                 check_only=None):
        """
        Create a directory at this location.

        :param path: The path to operate on.
        :param overwrite: Whether existing files/folders that conflict with this function are to be
            deleted/overwritten.
        :param clear: Whether the directory at this location must be empty for the function to be
            satisfied.
        :param fill: Whether the necessary parent folder(s) are to be created if the do not exist
            already.
        :param check_only: Whether the function should only check if it's possible, or actually
            perform the operation.
        :return: None
        """
        raise OperationNotSupportedError()