class Marten::Core::Storage::FileSystem
- Marten::Core::Storage::FileSystem
- Marten::Core::Storage::Base
- Reference
- Object
Overview
A basic file system storage that stores files locally.
Defined in:
marten/core/storage/file_system.crConstructors
Instance Method Summary
- 
        #delete(filepath : String) : Nil
        
          Deletes the file associated with the passed filepath.
- 
        #exists?(filepath : String) : Bool
        
          Returns true if the given filepathexists.
- 
        #open(filepath : String) : IO
        
          Returns an IO for the given filepath.
- 
        #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 methods inherited from class Marten::Core::Storage::Base
  
  
    
      delete(filepath : String) : Nil
    delete, 
    
  
    
      exists?(filepath : String) : Bool
    exists?, 
    
  
    
      open(filepath : String) : IO
    open, 
    
  
    
      save(filepath : String, content : IO) : String
    save, 
    
  
    
      size(filepath : String) : Int64
    size, 
    
  
    
      url(filepath : String) : String
    url, 
    
  
    
      write(filepath : String, content : IO) : Nil
    write
    
  
    
    
  
    
    
    
  
    
    
    
  
Constructor Detail
Instance Method Detail
Deletes the file associated with the passed filepath.
Returns true if the given filepath exists.
Returns an IO for the given filepath.
Raises Marten::Core::Storage::Errors::FileNotFound if the file does not exist.
Returns the size of a file at a given filepath.
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.