Remove old file path function.

This commit is contained in:
Gabriel Simmer 2021-05-23 14:46:28 +01:00
parent 54fe5f9c5c
commit b90abd8779
3 changed files with 0 additions and 18 deletions

View file

@ -140,10 +140,6 @@ func (bp *BackblazeProvider) GetDirectory(path string) Directory {
return finalDir
}
func (bp *BackblazeProvider) FilePath(path string) string {
return ""
}
func (bp *BackblazeProvider) SendFile(path string, w io.Writer) (stream io.Reader, contenttype string, err error) {
client := &http.Client{}
// Get bucket name >:(

View file

@ -38,7 +38,6 @@ type FileInfo struct {
type FileProviderInterface interface {
Setup(args map[string]string) (ok bool)
GetDirectory(path string) (directory Directory)
FilePath(path string) (realpath string)
SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error)
SaveFile(file io.Reader, filename string, path string) (ok bool)
ObjectInfo(path string) (exists bool, isDir bool, location string)
@ -58,11 +57,6 @@ func (f FileProvider) GetDirectory(path string) Directory {
return Directory{}
}
// FilePath returns the path to the file, whether it be a URL or local file path.
func (f FileProvider) FilePath(path string) string {
return ""
}
// RemoteFile will bypass http.ServeContent() and instead write directly to the response.
func (f FileProvider) SendFile(path string, writer io.Writer) (stream io.Reader, contenttype string, err error) {
return

View file

@ -24,10 +24,6 @@ func TestFileProvider(t *testing.T) {
t.Errorf("Default FileProvider GetDirectory() files returned %v, expected none.", getdirectory.Files)
}
filepath := fp.FilePath(""); if filepath != "" {
t.Errorf("Default FileProvider FilePath() %v, expected nothing.", filepath)
}
savefile := fp.SaveFile(nil, "", ""); if savefile != false {
t.Errorf("Default FileProvider SaveFile() attempted to save a file.")
}
@ -87,10 +83,6 @@ func TestDiskProvider(t *testing.T) {
t.Errorf("DiskProvider GetDirectory() files returned %v, expected 1.", getdirectory.Files)
}
filepath := dp.FilePath("testing.txt"); if filepath != DISK_TESTING_GROUNDS + "/testing.txt"{
t.Errorf("DiskProvider FilePath() returned %v, expected path.", filepath)
}
testfile := bytes.NewReader([]byte("second test file!"))
savefile := dp.SaveFile(testfile, "second_test.txt", ""); if savefile != true {
t.Errorf("DiskProvider SaveFile() could not save a file.")