From ecefa6cdd1e7376046bbec82c1b47f7756fea646 Mon Sep 17 00:00:00 2001 From: Daniel Schalla Date: Mon, 25 Jun 2018 18:12:59 +0200 Subject: Implementation of File Exists Function; Delete FileInfos upon Permanent User Delete (#8958) Check if file was deleted on FS Warning message if file couldnt be removed --- app/file.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/file.go') diff --git a/app/file.go b/app/file.go index aba09479a..add965fd7 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) FileExists(path string) (bool, *model.AppError) { + backend, err := a.FileBackend() + if err != nil { + return false, err + } + return backend.FileExists(path) +} + func (a *App) MoveFile(oldPath, newPath string) *model.AppError { backend, err := a.FileBackend() if err != nil { -- cgit v1.2.3-1-g7c22