fsNamesFromStorageObject extracts the names from the storage object
(storageObject string)
| 84 | |
| 85 | // fsNamesFromStorageObject extracts the names from the storage object |
| 86 | func fsNamesFromFileStorageObject(storageObject string) (containerName string, fileName string) { |
| 87 | // Remove the scheme |
| 88 | name := fsRemoveScheme(storageObject) |
| 89 | |
| 90 | // Split the container and filename |
| 91 | str := strings.Split(name, "/") |
| 92 | |
| 93 | // No container? Return the filename |
| 94 | if len(str) < 2 { |
| 95 | return "", str[0] |
| 96 | } |
| 97 | |
| 98 | // Return the container and filename, associating all subdir components with the container |
| 99 | return strings.Join(str[0:len(str)-1], "/"), str[len(str)-1] |
| 100 | } |
| 101 | |
| 102 | // FileCleanName generates a clean filename with correct extension from a filename input |
| 103 | func FileCleanName(filename string) string { |
no test coverage detected