|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.lib.RepositoryCache.FileKey
public static class RepositoryCache.FileKey
Location of a Repository, using the standard java.io.File API.
Constructor Summary | |
---|---|
protected |
RepositoryCache.FileKey(File directory,
FS fs)
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
static RepositoryCache.FileKey |
exact(File directory,
FS fs)
Obtain a pointer to an exact location on disk. |
File |
getFile()
|
int |
hashCode()
|
static boolean |
isGitRepository(File dir,
FS fs)
Guess if a directory contains a Git repository. |
static RepositoryCache.FileKey |
lenient(File directory,
FS fs)
Obtain a pointer to a location on disk. |
Repository |
open(boolean mustExist)
Called by RepositoryCache.open(Key) if it doesn't exist yet. |
static File |
resolve(File directory,
FS fs)
Guess the proper path for a Git repository. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RepositoryCache.FileKey(File directory, FS fs)
directory
- exact location of the repository.fs
- the file system abstraction which will be necessary to
perform certain file system operations.Method Detail |
---|
public static RepositoryCache.FileKey exact(File directory, FS fs)
No guessing is performed, the given location is exactly the GIT_DIR directory of the repository.
directory
- location where the repository database is.fs
- the file system abstraction which will be necessary to
perform certain file system operations.
lenient(File, FS)
public static RepositoryCache.FileKey lenient(File directory, FS fs)
The method performs some basic guessing to locate the repository. Searched paths are:
directory
// assume exact matchdirectory
+ "/.git" // assume working directorydirectory
+ ".git" // assume bare
directory
- location where the repository database might be.fs
- the file system abstraction which will be necessary to
perform certain file system operations.
exact(File, FS)
public final File getFile()
public Repository open(boolean mustExist) throws IOException
RepositoryCache.Key
RepositoryCache.open(Key)
if it doesn't exist yet.
If a repository does not exist yet in the cache, the cache will call this method to acquire a handle to it.
open
in interface RepositoryCache.Key
mustExist
- true if the repository must exist in order to be opened;
false if a new non-existent repository is permitted to be
created (the caller is responsible for calling create).
IOException
- the repository could not be read (likely its core.version
property is not supported).
RepositoryNotFoundException
- There is no repository at the given location, only thrown
if mustExist
is true.public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
public static boolean isGitRepository(File dir, FS fs)
This method guesses by looking for the existence of some key files and directories.
dir
- the location of the directory to examine.fs
- the file system abstraction which will be necessary to
perform certain file system operations.
public static File resolve(File directory, FS fs)
The method performs some basic guessing to locate the repository. Searched paths are:
directory
// assume exact matchdirectory
+ "/.git" // assume working directorydirectory
+ ".git" // assume bare
directory
- location to guess from. Several permutations are tried.fs
- the file system abstraction which will be necessary to
perform certain file system operations.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |