public final class LocalRepoHelper extends Object
Modifier and Type | Method and Description |
---|---|
static File |
getLocalRootContainingFile(File file)
Gets the local root containing the given
file . |
static Collection<File> |
getLocalRootsContainedInDirectory(File directory) |
public static File getLocalRootContainingFile(File file)
file
.
If file
itself is the root of a repository, it is returned directly.
If file
is a directory or file inside the repository, the parent-directory
being the repository's root is returned.
If file
is not contained in any repository, null
is returned.
file
- the directory or file for which to search the repository's local root. Must not be null
.null
, if file
is not located inside a repository.public static Collection<File> getLocalRootsContainedInDirectory(File directory)
Copyright © 2013–2019. All rights reserved.