abstract class Marten::Core::Storage::Base
- Marten::Core::Storage::Base
- Reference
- Object
Overview
Abstract base class representing a file storage.
Direct Known Subclasses
Defined in:
marten/core/storage/base.crInstance Method Summary
-
#delete(filepath : String) : Nil
Deletes the file associated with the passed
filepath
. -
#exists?(filepath : String) : Bool
Returns true if the given
filepath
exists. -
#open(filepath : String) : IO
Returns an IO for the given
filepath
. -
#save(filepath : String, content : IO) : String
Save a file content into the storage by taking care of not overwriting any existing file.
-
#size(filepath : String) : Int64
Returns the size of a file at a given
filepath
. -
#url(filepath : String) : String
Returns the URL associated with the passed file name or file path.
-
#write(filepath : String, content : IO) : Nil
Write a file's content into the storage.
Instance Method Detail
Deletes the file associated with the passed filepath
.
Returns an IO for the given filepath
.
Raises Marten::Core::Storage::Errors::FileNotFound
if the file does not exist.
Save a file content into the storage by taking care of not overwriting any existing file.
The method returns the filepath of the saved file.
Returns the URL associated with the passed file name or file path.
Write a file's content into the storage.
This is a destructive operation: any existing file with the same filepath
will be overwritten.