diff --git a/internal/photos/api/storage.go b/internal/photos/api/storage.go index b6b0d3e..44d8b39 100644 --- a/internal/photos/api/storage.go +++ b/internal/photos/api/storage.go @@ -2,6 +2,7 @@ package photosapi import ( "fmt" + "io/fs" "os" "path/filepath" ) @@ -24,7 +25,7 @@ func (s *Storage) Create(paths ...string) error { } func (s *Storage) Exists(paths ...string) bool { - f, err := os.Stat(s.Join(paths...)) + f, err := s.Stat(paths...) if err != nil { return false } @@ -38,3 +39,7 @@ func (s *Storage) Delete(paths ...string) error { return fmt.Errorf("%s doesn't exists", s.Join(paths...)) } } + +func (s *Storage) Stat(paths ...string) (fs.FileInfo, error) { + return os.Stat(s.Join(paths...)) +}