(sourceFilePath string)
| 187 | } |
| 188 | |
| 189 | func (u *S3) move(sourceFilePath string) error { |
| 190 | relPath, err := filepath.Rel(u.Cfg.SourceBasePath, sourceFilePath) |
| 191 | if err != nil { |
| 192 | return err |
| 193 | } |
| 194 | |
| 195 | destinationPath := filepath.Join(u.Cfg.StagingPath, relPath) |
| 196 | |
| 197 | dir := path.Dir(destinationPath) |
| 198 | if err := os.MkdirAll(dir, 0777); err != nil { |
| 199 | return err |
| 200 | } |
| 201 | |
| 202 | return os.Rename(sourceFilePath, destinationPath) |
| 203 | } |
| 204 | |
| 205 | func (u *S3) Stop() { |
| 206 | // Stop may be called by the Topology in case of early exit (i.e CTRL-C), |
no outgoing calls