Package org.eclipse.jgit.errors

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));

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


        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));

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

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

      fmt.append(e.getNameUTF8(), e.getMode(), id);
    }
    return fmt.toByteArray();
View Full Code Here

    default:
      break;
    }

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

      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

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

      fmt.append(e.getNameUTF8(), e.getMode(), id);
    }
    return fmt.toByteArray();
View Full Code Here

    default:
      break;
    }

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

        lck.setFSync(true);
        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

        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));

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

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

      fmt.append(e.getNameUTF8(), e.getMode(), id);
    }
    return fmt.toByteArray();
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.errors.ObjectWritingException

Copyright © 2018 www.massapicom. 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.