diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-06-22 11:15:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 11:15:19 +0200 |
commit | d9390244afe90ed318ac8c263c19328f16dc2562 (patch) | |
tree | 82e834f259655acec6842b7adc19dff436f8a33d /utils/file_backend_local.go | |
parent | 8526739066ccb00ccd24b74650a7d7b284442985 (diff) | |
download | chat-d9390244afe90ed318ac8c263c19328f16dc2562.tar.gz chat-d9390244afe90ed318ac8c263c19328f16dc2562.tar.bz2 chat-d9390244afe90ed318ac8c263c19328f16dc2562.zip |
MM-8810: Add CSV Compliance export (#8966)
* MM-8810: Add CSV Compliance export
* Only allowing to schedule actiances export throught the cli
* De-duplicating some code
* Fixes on texts
* Fixes on translations
Diffstat (limited to 'utils/file_backend_local.go')
-rw-r--r-- | utils/file_backend_local.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/file_backend_local.go b/utils/file_backend_local.go index a2d311f83..ec0c657a7 100644 --- a/utils/file_backend_local.go +++ b/utils/file_backend_local.go @@ -33,6 +33,14 @@ func (b *LocalFileBackend) TestConnection() *model.AppError { return nil } +func (b *LocalFileBackend) Reader(path string) (io.ReadCloser, *model.AppError) { + if f, err := os.Open(filepath.Join(b.directory, path)); err != nil { + return nil, model.NewAppError("Reader", "api.file.reader.reading_local.app_error", nil, err.Error(), http.StatusInternalServerError) + } else { + return f, nil + } +} + func (b *LocalFileBackend) ReadFile(path string) ([]byte, *model.AppError) { if f, err := ioutil.ReadFile(filepath.Join(b.directory, path)); err != nil { return nil, model.NewAppError("ReadFile", "api.file.read_file.reading_local.app_error", nil, err.Error(), http.StatusInternalServerError) |