MCPcopy
hub / github.com/AlistGo/alist / getPathForRemote

Method getPathForRemote

drivers/crypt/util.go:25–38  ·  view source on GitHub ↗
(path string, isFolder bool)

Source from the content-addressed store, hash-verified

23}
24
25func (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
41func (d *Crypt) getActualPathForRemote(path string, isFolder bool) (string, error) {

Callers 3

ListMethod · 0.95
GetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected