func (a *basicDownloadAdapter) tempDir() string { // Must be dedicated to this adapter as deleted by ClearTempStorage // Also make local to this repo not global, and separate to localstorage temp, // which gets cleared at the end of every invocation d := filepath.Join(localstorage.Objects().RootDir, "incomplete") if err := os.MkdirAll(d, 0755); err != nil { return os.TempDir() } return d }
func ObjectExistsOfSize(oid string, size int64) bool { path := localstorage.Objects().ObjectPath(oid) return tools.FileExistsOfSize(path, size) }
func LocalMediaPath(oid string) (string, error) { return localstorage.Objects().BuildObjectPath(oid) }
func LocalMediaPathReadOnly(oid string) string { return localstorage.Objects().ObjectPath(oid) }
func LocalObjectTempDir() string { if localstorage.Objects() != nil { return localstorage.Objects().TempDir } return "" }
// LocalMediaDir returns the root of lfs objects func LocalMediaDir() string { if localstorage.Objects() != nil { return localstorage.Objects().RootDir } return "" }
// only used in tests func AllObjects() []localstorage.Object { return localstorage.Objects().AllObjects() }
func ScanObjectsChan() <-chan localstorage.Object { return localstorage.Objects().ScanObjectsChan() }
func ClearTempObjects() error { if localstorage.Objects() == nil { return nil } return localstorage.Objects().ClearTempObjects() }