(path string, isFolder bool)
| 23 | } |
| 24 | |
| 25 | func (d *Crypt) getPathForRemote(path string, isFolder bool) (remoteFullPath string) { |
| 26 | if isFolder && !strings.HasSuffix(path, "/") { |
| 27 | path = path + "/" |
| 28 | } |
| 29 | dir, fileName := filepath.Split(path) |
| 30 | |
| 31 | remoteDir := d.cipher.EncryptDirName(dir) |
| 32 | remoteFileName := "" |
| 33 | if len(strings.TrimSpace(fileName)) > 0 { |
| 34 | remoteFileName = d.cipher.EncryptFileName(fileName) |
| 35 | } |
| 36 | return stdpath.Join(d.RemotePath, remoteDir, remoteFileName) |
| 37 | |
| 38 | } |
| 39 | |
| 40 | // actual path is used for internal only. any link for user should come from remoteFullPath |
| 41 | func (d *Crypt) getActualPathForRemote(path string, isFolder bool) (string, error) { |
no outgoing calls
no test coverage detected