/** * Create a new empty index which is never stored on disk. * * @return an empty cache which has no backing store file. The cache may not * be read or written, but it may be queried and updated (in * memory). */ public static DirCache newInCore() { return new DirCache(null, null); }
/** * Create a new in-core index representation and read an index from disk. * <p> * The new index will be read before it is returned to the caller. Read * failures are reported as exceptions and therefore prevent the method from * returning a partially populated index. * * @param indexLocation * location of the index file on disk. * @param fs * the file system abstraction which will be necessary to perform * certain file system operations. * @return a cache representing the contents of the specified index file (if * it exists) or an empty cache if the file does not exist. * @throws java.io.IOException * the index file is present but could not be read. * @throws org.eclipse.jgit.errors.CorruptObjectException * the index file is using a format or extension that this * library does not support. */ public static DirCache read(File indexLocation, FS fs) throws CorruptObjectException, IOException { final DirCache c = new DirCache(indexLocation, fs); c.read(); return c; }
final DirCache c = new DirCache(indexLocation, fs); if (!c.lock()) throw new LockFailedException(indexLocation);
/** * Create a new empty index which is never stored on disk. * * @return an empty cache which has no backing store file. The cache may not * be read or written, but it may be queried and updated (in * memory). */ public static DirCache newInCore() { return new DirCache(null, null); }
/** * Create a new empty index which is never stored on disk. * * @return an empty cache which has no backing store file. The cache may not * be read or written, but it may be queried and updated (in * memory). */ public static DirCache newInCore() { return new DirCache(null, null); }
/** * Create a new in-core index representation and read an index from disk. * <p> * The new index will be read before it is returned to the caller. Read * failures are reported as exceptions and therefore prevent the method from * returning a partially populated index. * * @param indexLocation * location of the index file on disk. * @param fs * the file system abstraction which will be necessary to perform * certain file system operations. * @return a cache representing the contents of the specified index file (if * it exists) or an empty cache if the file does not exist. * @throws IOException * the index file is present but could not be read. * @throws CorruptObjectException * the index file is using a format or extension that this * library does not support. */ public static DirCache read(final File indexLocation, final FS fs) throws CorruptObjectException, IOException { final DirCache c = new DirCache(indexLocation, fs); c.read(); return c; }
/** * Create a new in-core index representation and read an index from disk. * <p> * The new index will be read before it is returned to the caller. Read * failures are reported as exceptions and therefore prevent the method from * returning a partially populated index. * * @param indexLocation * location of the index file on disk. * @param fs * the file system abstraction which will be necessary to perform * certain file system operations. * @return a cache representing the contents of the specified index file (if * it exists) or an empty cache if the file does not exist. * @throws java.io.IOException * the index file is present but could not be read. * @throws org.eclipse.jgit.errors.CorruptObjectException * the index file is using a format or extension that this * library does not support. */ public static DirCache read(File indexLocation, FS fs) throws CorruptObjectException, IOException { final DirCache c = new DirCache(indexLocation, fs); c.read(); return c; }
final DirCache c = new DirCache(indexLocation, fs); if (!c.lock()) throw new LockFailedException(indexLocation);
final DirCache c = new DirCache(indexLocation, fs); if (!c.lock()) throw new LockFailedException(indexLocation);