Fixed a bug where files and file directories were not recursively recognized correctly when using Amazon S3 storage policies for external file imports.
This commit is contained in:
parent
3edb00a648
commit
f264b44b0e
1 changed files with 19 additions and 8 deletions
|
@ -147,14 +147,25 @@ func (handler *Driver) List(ctx context.Context, base string, recursive bool) ([
|
|||
if err != nil {
|
||||
continue
|
||||
}
|
||||
res = append(res, response.Object{
|
||||
Name: path.Base(*object.Key),
|
||||
Source: *object.Key,
|
||||
RelativePath: filepath.ToSlash(rel),
|
||||
Size: uint64(*object.Size),
|
||||
IsDir: false,
|
||||
LastModify: time.Now(),
|
||||
})
|
||||
|
||||
if strings.HasSuffix(*object.Key, "/") {
|
||||
res = append(res, response.Object{
|
||||
Name: path.Base(*object.Key),
|
||||
RelativePath: filepath.ToSlash(rel),
|
||||
Size: 0,
|
||||
IsDir: true,
|
||||
LastModify: time.Now(),
|
||||
})
|
||||
} else {
|
||||
res = append(res, response.Object{
|
||||
Name: path.Base(*object.Key),
|
||||
Source: *object.Key,
|
||||
RelativePath: filepath.ToSlash(rel),
|
||||
Size: uint64(*object.Size),
|
||||
IsDir: false,
|
||||
LastModify: *object.LastModified,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return res, nil
|
||||
|
|
Loading…
Add table
Reference in a new issue