File should ideally be just an value object. However, it currently knows FileRepo and MediaHandler instances, and exposes them via the getRepo resp. getHandler methods. These should either be removed, or an interface (FileIdentity or some such) should be introduced that does not expose any service-like (non-value) objects.
Classes such as Linker should type-hint against the new interface instead of File, to avoid a dependency on FileRepo.
In case the File is exposed to extensions, a survey of hook handlers should be made to assess whether any extensions would break when File is replaced by a more narrow value object.