mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Support for "directory" objects (#10499)
This commit is contained in:
17
cmd/utils.go
17
cmd/utils.go
@@ -737,3 +737,20 @@ func (t *timedValue) Invalidate() {
|
||||
t.value = nil
|
||||
t.mu.Unlock()
|
||||
}
|
||||
|
||||
// On MinIO a directory object is stored as a regular object with "__XLDIR__" suffix.
|
||||
// For ex. "prefix/" is stored as "prefix__XLDIR__"
|
||||
func encodeDirObject(object string) string {
|
||||
if HasSuffix(object, slashSeparator) {
|
||||
return strings.TrimSuffix(object, slashSeparator) + globalDirSuffix
|
||||
}
|
||||
return object
|
||||
}
|
||||
|
||||
// Reverse process of encodeDirObject()
|
||||
func decodeDirObject(object string) string {
|
||||
if HasSuffix(object, globalDirSuffix) {
|
||||
return strings.TrimSuffix(object, globalDirSuffix) + slashSeparator
|
||||
}
|
||||
return object
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user