ftp: use lib/encoder

This commit is contained in:
Nick Craig-Wood
2019-09-30 22:00:24 +01:00
parent ced2616da5
commit 32af4cd6f3
4 changed files with 74 additions and 16 deletions
+11
View File
@@ -222,6 +222,17 @@ const Pcloud = encoder.MultiEncoder(
encoder.EncodeBackSlash |
encoder.EncodeInvalidUtf8)
// FTP is the encoding used by the ftp backend
//
// The FTP protocal can't handle trailing spaces (for instance
// pureftpd turns them into _)
//
// proftpd can't handle '*' in file names
// pureftpd can't handle '[', ']' or '*'
const FTP = encoder.MultiEncoder(
uint(Display) |
encoder.EncodeRightSpace)
// ByName returns the encoder for a give backend name or nil
func ByName(name string) encoder.Encoder {
switch strings.ToLower(name) {
+1
View File
@@ -19,6 +19,7 @@ const (
Box = Base
Drive = Base
Dropbox = Base
FTP = Base
GoogleCloudStorage = Base
JottaCloud = Base
Koofr = Base