Package org.eclipse.jgit.internal.storage.file

Examples of org.eclipse.jgit.internal.storage.file.LockFile.unlock()


    final LockFile tmp = myLock;
    requireLocked(tmp);
    try {
      writeTo(new SafeBufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
View Full Code Here


      writeTo(new SafeBufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
      tmp.unlock();
      throw err;
    }
View Full Code Here

      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
      tmp.unlock();
      throw err;
    }
  }

  void writeTo(final OutputStream os) throws IOException {
View Full Code Here

   */
  public void unlock() {
    final LockFile tmp = myLock;
    if (tmp != null) {
      myLock = null;
      tmp.unlock();
    }
  }

  /**
   * Locate the position a path's entry is at in the index. For details refer
View Full Code Here

          w.close();
        }
        lock.commit();
      }
    } finally {
      lock.unlock();
    }
  }

  private boolean askForIsComplete() throws TransportException {
    try {
View Full Code Here

      lf.setNeedSnapshot(true);
      lf.write(out);
      if (!lf.commit())
        throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile()));
    } finally {
      lf.unlock();
    }
    snapshot = lf.getCommitSnapshot();
    hash = hash(out);
    // notify the listeners
    fireConfigChangedEvent();
View Full Code Here

    try {
      git.checkout().setName(commit1.name()).call();
      fail("JGitInternalException not thrown");
    } catch (JGitInternalException e) {
      assertTrue(e.getCause() instanceof LockFailedException);
      lf.unlock();
      git.checkout().setName(commit1.name()).call();
    }
  }
}
View Full Code Here

      lf.setNeedSnapshot(true);
      lf.write(out);
      if (!lf.commit())
        throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile()));
    } finally {
      lf.unlock();
    }
    snapshot = lf.getCommitSnapshot();
    hash = hash(out);
    // notify the listeners
    fireConfigChangedEvent();
View Full Code Here

    final LockFile tmp = myLock;
    requireLocked(tmp);
    try {
      writeTo(new SafeBufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
View Full Code Here

      writeTo(new SafeBufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
      tmp.unlock();
      throw err;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.