Examples of ObjectWritingException


Examples of org.eclipse.jgit.errors.ObjectWritingException

    default:
      break;
    }

    final File dst = db.fileFor(id);
    throw new ObjectWritingException("Unable to create new object: " + dst);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

        lck.setFSync(true);
        lck.setNeedSnapshot(true);
        try {
          lck.write(content);
        } catch (IOException ioe) {
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name), ioe);
        }
        try {
          lck.waitForStatChange();
        } catch (InterruptedException e) {
          lck.unlock();
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().interruptedWriting, name));
        }
        if (!lck.commit())
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name));

        byte[] digest = Constants.newMessageDigest().digest(content);
        packedRefs.compareAndSet(oldPackedList, new PackedRefList(refs,
            lck.getCommitSnapshot(), ObjectId.fromRaw(digest)));
      }
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

  private void writeFile(final File p, final byte[] bin) throws IOException,
      ObjectWritingException {
    final LockFile lck = new LockFile(p, db.getFS());
    if (!lck.lock())
      throw new ObjectWritingException("Can't write " + p);
    try {
      lck.write(bin);
    } catch (IOException ioe) {
      throw new ObjectWritingException("Can't write " + p);
    }
    if (!lck.commit())
      throw new ObjectWritingException("Can't write " + p);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

      protected void writeFile(final String name, final byte[] content)
          throws IOException {
        final File file = new File(db.getDirectory(), name);
        final LockFile lck = new LockFile(file, db.getFS());
        if (!lck.lock())
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
        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

Examples of org.eclipse.jgit.errors.ObjectWritingException

  private void writeFile(final File p, final byte[] bin) throws IOException,
      ObjectWritingException {
    final LockFile lck = new LockFile(p, db.getFS());
    if (!lck.lock())
      throw new ObjectWritingException("Can't write " + p);
    try {
      lck.write(bin);
    } catch (IOException ioe) {
      throw new ObjectWritingException("Can't write " + p);
    }
    if (!lck.commit())
      throw new ObjectWritingException("Can't write " + p);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

      protected void writeFile(final String name, final byte[] content)
          throws IOException {
        final File file = new File(db.getDirectory(), name);
        final LockFile lck = new LockFile(file, db.getFS());
        if (!lck.lock())
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
        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

Examples of org.eclipse.jgit.errors.ObjectWritingException

    ru = objdb.updateRef(Constants.R_TAGS + getTag());
    ru.setNewObjectId(id);
    ru.setRefLogMessage("tagged " + getTag(), false);
    if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE)
      throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToLockTag, getTag()));
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

  public final byte[] format(Tree tree) throws IOException {
    ByteArrayOutputStream o = new ByteArrayOutputStream();
    for (TreeEntry e : tree.members()) {
      ObjectId id = e.getId();
      if (id == null)
        throw new ObjectWritingException(MessageFormat.format(JGitText
            .get().objectAtPathDoesNotHaveId, e.getFullName()));

      e.getMode().copyTo(o);
      o.write(' ');
      o.write(e.getNameUTF8());
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

          throws IOException {
        lck.setNeedStatInformation(true);
        try {
          lck.write(content);
        } catch (IOException ioe) {
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name), ioe);
        }
        try {
          lck.waitForStatChange();
        } catch (InterruptedException e) {
          lck.unlock();
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().interruptedWriting, name));
        }
        if (!lck.commit())
          throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name));

        packedRefs.compareAndSet(oldPackedList, new PackedRefList(refs,
            content.length, lck.getCommitLastModified()));
      }
    }.writePackedRefs();
View Full Code Here

Examples of org.eclipse.jgit.errors.ObjectWritingException

    // location and it doesn't exist in the repository
    // either. We really don't know what went wrong, so
    // fail.
    //
    tmp.delete();
    throw new ObjectWritingException("Unable to create new object: " + dst);
  }
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.