diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/file.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/file.go b/app/file.go index 95d11afed..537f76aaa 100644 --- a/app/file.go +++ b/app/file.go @@ -70,6 +70,14 @@ func (a *App) ReadFile(path string) ([]byte, *model.AppError) { return backend.ReadFile(path) } +func (a *App) FileReader(path string) (io.Reader, *model.AppError) { + backend, err := a.FileBackend() + if err != nil { + return nil, err + } + return backend.Reader(path) +} + func (a *App) FileExists(path string) (bool, *model.AppError) { backend, err := a.FileBackend() if err != nil { |