MCPcopy Create free account
hub / github.com/aptly-dev/aptly / FileExists

Method FileExists

gcs/public.go:396–412  ·  view source on GitHub ↗

FileExists returns true if path exists.

(path string)

Source from the content-addressed store, hash-verified

394
395// FileExists returns true if path exists.
396func (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.
415func (g *PublishedStorage) ReadLink(path string) (string, error) {

Callers

nothing calls this directly

Calls 1

objectHandleMethod · 0.95

Tested by

no test coverage detected