Package org.eclipse.jgit.storage.file

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


          out.write(tmp, 0, n);
        }
      } finally {
        out.close();
      }
      if (!lf.commit()) {
        throw new IOException("Cannot commit " + dst);
      }
    } finally {
      lf.unlock();
    }
View Full Code Here


                out.write(tmp, 0, n);
              }
            } finally {
              out.close();
            }
            if (!lf.commit()) {
              throw new IOException("Cannot commit " + siteWar);
            }
          } finally {
            lf.unlock();
          }
View Full Code Here

   */
  public boolean commit() {
    final LockFile tmp = myLock;
    requireLocked(tmp);
    myLock = null;
    if (!tmp.commit())
      return false;
    lastModified = tmp.getCommitLastModified();
    return true;
  }

View Full Code Here

    try {
      lck.write(bin);
    } catch (IOException ioe) {
      throw new ObjectWritingException("Can't write " + p);
    }
    if (!lck.commit())
      throw new ObjectWritingException("Can't write " + p);
  }

  /** Helper to build a branch with one or more commits */
  public class BranchBuilder {
View Full Code Here

      final LockFile lf;
      lf = new LockFile(new File(db.getDirectory(), Constants.HEAD), db.getFS());
      if (!lf.lock())
        throw new IOException(MessageFormat.format(CLIText.get().cannotLock, Constants.HEAD));
      lf.write(id);
      if (!lf.commit())
        throw new IOException(CLIText.get().cannotDeatchHEAD);
    }
  }

  private void deleteAllRefs() throws Exception {
View Full Code Here

        try {
          lck.write(content);
        } catch (IOException ioe) {
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
        }
        if (!lck.commit())
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
      }
    }.writePackedRefs();
  }
View Full Code Here

            result.add(h);
          }
        } finally {
          w.close();
        }
        lock.commit();
      }
    } finally {
      lock.unlock();
    }
  }
View Full Code Here

        if (!current.contains(cq))
          cfg.unsetSection(S_CQ, Long.toString(cq.getID()));
      }

      lf.write(Constants.encode(cfg.toText()));
      if (!lf.commit())
        throw new IOException(MessageFormat.format(IpLogText.get().cannotWrite, file));
    } finally {
      lf.unlock();
    }
  }
View Full Code Here

        try {
          log.writeTo(os);
        } finally {
          os.close();
        }
        if (!lf.commit())
          throw die(MessageFormat.format(CLIText.get().cannotWrite, output));
      } finally {
        lf.unlock();
      }
    } else {
View Full Code Here

            result.add(h);
          }
        } finally {
          w.close();
        }
        lock.commit();
      }
    } finally {
      lock.unlock();
    }
  }
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.