FileExists returns true if path exists.
(path string)
| 394 | |
| 395 | // FileExists returns true if path exists. |
| 396 | func (g *PublishedStorage) FileExists(path string) (bool, error) { |
| 397 | _, err := g.objectHandle(path).Attrs(context.TODO()) |
| 398 | if err != nil { |
| 399 | if err == storage.ErrObjectNotExist { |
| 400 | return false, nil |
| 401 | } |
| 402 | |
| 403 | var apiErr *googleapi.Error |
| 404 | if errors.As(err, &apiErr) && apiErr.Code == 404 { |
| 405 | return false, nil |
| 406 | } |
| 407 | |
| 408 | return false, err |
| 409 | } |
| 410 | |
| 411 | return true, nil |
| 412 | } |
| 413 | |
| 414 | // ReadLink returns symbolic link target from metadata. |
| 415 | func (g *PublishedStorage) ReadLink(path string) (string, error) { |
nothing calls this directly
no test coverage detected