Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.LockFile.lock()


      String password) throws IOException, ConfigInvalidException {
    if (!file.getParentFile().exists())
      file.getParentFile().mkdirs();

    LockFile lf = new LockFile(file, fs);
    if (!lf.lock())
      throw new IOException(MessageFormat.format(IpLogText.get().cannotLock, file));
    try {
      FileBasedConfig cfg = new FileBasedConfig(file, fs);
      cfg.load();
      loadFrom(cfg);
View Full Code Here


    if (output != null) {
      if (!output.getParentFile().exists())
        output.getParentFile().mkdirs();
      LockFile lf = new LockFile(output, db.getFS());
      if (!lf.lock())
        throw die(MessageFormat.format(CLIText.get().cannotLock, output));
      try {
        OutputStream os = lf.getOutputStream();
        try {
          log.writeTo(os);
View Full Code Here

   */
  public boolean lock() throws IOException {
    if (liveFile == null)
      throw new IOException(JGitText.get().dirCacheDoesNotHaveABackingFile);
    final LockFile tmp = new LockFile(liveFile, fs);
    if (tmp.lock()) {
      tmp.setNeedStatInformation(true);
      myLock = tmp;
      return true;
    }
    return false;
View Full Code Here

    if (meta == null)
      return;
    final LockFile lock = new LockFile(new File(meta, "FETCH_HEAD"),
        transport.local.getFS());
    try {
      if (lock.lock()) {
        final Writer w = new OutputStreamWriter(lock.getOutputStream());
        try {
          for (final FetchHeadRecord h : fetchHeadUpdates) {
            h.write(w);
            result.add(h);
View Full Code Here

   */
  public boolean lock() throws IOException {
    if (liveFile == null)
      throw new IOException(JGitText.get().dirCacheDoesNotHaveABackingFile);
    final LockFile tmp = new LockFile(liveFile, fs);
    if (tmp.lock()) {
      tmp.setNeedStatInformation(true);
      myLock = tmp;
      return true;
    }
    return false;
View Full Code Here

    if (meta == null)
      return;
    final LockFile lock = new LockFile(new File(meta, "FETCH_HEAD"),
        transport.local.getFS());
    try {
      if (lock.lock()) {
        final Writer w = new OutputStreamWriter(lock.getOutputStream());
        try {
          for (final FetchHeadRecord h : fetchHeadUpdates) {
            h.write(w);
            result.add(h);
View Full Code Here

   */
  public boolean lock() throws IOException {
    if (liveFile == null)
      throw new IOException(JGitText.get().dirCacheDoesNotHaveABackingFile);
    final LockFile tmp = new LockFile(liveFile, fs);
    if (tmp.lock()) {
      tmp.setNeedStatInformation(true);
      myLock = tmp;
      return true;
    }
    return false;
View Full Code Here

    if (meta == null)
      return;
    final LockFile lock = new LockFile(new File(meta, "FETCH_HEAD"), //$NON-NLS-1$
        transport.local.getFS());
    try {
      if (lock.lock()) {
        final Writer w = new OutputStreamWriter(lock.getOutputStream());
        try {
          for (final FetchHeadRecord h : fetchHeadUpdates) {
            h.write(w);
            result.add(h);
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.