Support for "directory" objects (#10499)

This commit is contained in:
Krishna Srinivas
2020-09-19 08:39:41 -07:00
committed by GitHub
parent 7f9498f43f
commit 230fc0d186
8 changed files with 122 additions and 32 deletions

View File

@@ -22,12 +22,18 @@ import (
"fmt"
"io"
"path"
"strings"
)
// Converts underlying storage error. Convenience function written to
// handle all cases where we have known types of errors returned by
// underlying storage layer.
func toObjectErr(err error, params ...string) error {
if len(params) > 1 {
if HasSuffix(params[1], globalDirSuffix) {
params[1] = strings.TrimSuffix(params[1], globalDirSuffix) + slashSeparator
}
}
switch err {
case errVolumeNotFound:
if len(params) >= 1 {