(key string)
| 733 | } |
| 734 | |
| 735 | func (fs *HDFSFileStore) CreateFilePath(key string) (filestore.Filepath, error) { |
| 736 | fp := filestore.HDFSFilepath{} |
| 737 | if err := fp.SetScheme(filestore.HDFSPrefix); err != nil { |
| 738 | return nil, err |
| 739 | } |
| 740 | |
| 741 | fullKey := fmt.Sprintf("/%s", strings.TrimPrefix(key, "/")) |
| 742 | if fs.Path != "" { |
| 743 | fullKey = fmt.Sprintf("/%s/%s", strings.TrimPrefix(fs.Path, "/"), strings.TrimPrefix(key, "/")) |
| 744 | } |
| 745 | if err := fp.SetKey(fullKey); err != nil { |
| 746 | return nil, err |
| 747 | } |
| 748 | fp.SetIsDir(false) |
| 749 | err := fp.Validate() |
| 750 | if err != nil { |
| 751 | return nil, err |
| 752 | } |
| 753 | return &fp, nil |
| 754 | } |
| 755 | |
| 756 | type genericFileStore struct { |
| 757 | bucket *blob.Bucket |
no test coverage detected