@ -116,13 +116,14 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ
// If root was an object return it as such.
// If root was an object return it as such.
if HasSuffix ( entry , xlStorageFormatFile ) {
if HasSuffix ( entry , xlStorageFormatFile ) {
var meta metaCacheEntry
var meta metaCacheEntry
meta . metadata , err = ioutil . ReadFile ( pathJoin ( volumeDir , meta . name , xlStorageFormatFile ) )
meta . metadata , err = ioutil . ReadFile ( pathJoin ( volumeDir , current , entry ) )
if err != nil {
if err != nil {
logger . LogIf ( ctx , err )
logger . LogIf ( ctx , err )
continue
continue
}
}
meta . name = strings . TrimSuffix ( meta . name , xlStorageFormatFile )
meta . name = strings . TrimSuffix ( entry , xlStorageFormatFile )
meta . name = strings . TrimSuffix ( meta . name , SlashSeparator )
meta . name = strings . TrimSuffix ( meta . name , SlashSeparator )
meta . name = pathJoin ( current , meta . name )
meta . name = decodeDirObject ( meta . name )
meta . name = decodeDirObject ( meta . name )
out <- meta
out <- meta
return nil
return nil
@ -130,13 +131,14 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ
// Check legacy.
// Check legacy.
if HasSuffix ( entry , xlStorageFormatFileV1 ) {
if HasSuffix ( entry , xlStorageFormatFileV1 ) {
var meta metaCacheEntry
var meta metaCacheEntry
meta . metadata , err = ioutil . ReadFile ( pathJoin ( volumeDir , meta . name , xlStorageFormatFileV1 ) )
meta . metadata , err = ioutil . ReadFile ( pathJoin ( volumeDir , current , entry ) )
if err != nil {
if err != nil {
logger . LogIf ( ctx , err )
logger . LogIf ( ctx , err )
continue
continue
}
}
meta . name = strings . TrimSuffix ( meta . name , xlStorageFormatFileV1 )
meta . name = strings . TrimSuffix ( entry , xlStorageFormatFileV1 )
meta . name = strings . TrimSuffix ( meta . name , SlashSeparator )
meta . name = strings . TrimSuffix ( meta . name , SlashSeparator )
meta . name = pathJoin ( current , meta . name )
out <- meta
out <- meta
return nil
return nil
}
}