private ObjectId insertOneObject( File tmp, ObjectId id, boolean createDuplicate) throws IOException, ObjectWritingException { switch (db.insertUnpackedObject(tmp, id, createDuplicate)) { case INSERTED: case EXISTS_PACKED: case EXISTS_LOOSE: return id; case FAILURE: default: break; } final File dst = db.fileFor(id); throw new ObjectWritingException(MessageFormat .format(JGitText.get().unableToCreateNewObject, dst)); }
/** * Constructs an ObjectWritingException with the specified detail message. * * @param s message * @param cause root cause exception */ public ObjectWritingException(String s, Throwable cause) { super(s); initCause(cause); } }
lck.write(content); } catch (IOException ioe) { throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name), ioe); } catch (InterruptedException e) { lck.unlock(); throw new ObjectWritingException(MessageFormat.format(JGitText.get().interruptedWriting, name)); throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name)); p -> p.id.equals(oldPackedList.id) ? newPackedList : p); if (!afterUpdate.id.equals(newPackedList.id)) { throw new ObjectWritingException( MessageFormat.format(JGitText.get().unableToWrite, name));
/** * Constructs an ObjectWritingException with the specified detail message. * * @param s message * @param cause root cause exception */ public ObjectWritingException(final String s, final Throwable cause) { super(s); initCause(cause); } }
private void writeFile(File p, byte[] bin) throws IOException, ObjectWritingException { final LockFile lck = new LockFile(p); 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); }
/** * Constructs an ObjectWritingException with the specified detail message. * * @param s message * @param cause root cause exception */ public ObjectWritingException(String s, Throwable cause) { super(s); initCause(cause); } }
private void writeFile(final File p, final byte[] bin) throws IOException, ObjectWritingException { final LockFile lck = new LockFile(p); 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); }
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); }
@Override 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();
private ObjectId insertOneObject(final File tmp, final ObjectId id) throws IOException, ObjectWritingException { switch (db.insertUnpackedObject(tmp, id, false /* no duplicate */)) { case INSERTED: case EXISTS_PACKED: case EXISTS_LOOSE: return id; case FAILURE: default: break; } final File dst = db.fileFor(id); throw new ObjectWritingException(MessageFormat .format(JGitText.get().unableToCreateNewObject, dst)); }
private ObjectId insertOneObject( File tmp, ObjectId id, boolean createDuplicate) throws IOException, ObjectWritingException { switch (db.insertUnpackedObject(tmp, id, createDuplicate)) { case INSERTED: case EXISTS_PACKED: case EXISTS_LOOSE: return id; case FAILURE: default: break; } final File dst = db.fileFor(id); throw new ObjectWritingException(MessageFormat .format(JGitText.get().unableToCreateNewObject, dst)); }
@Override protected void writeFile(String name, byte[] content) throws IOException { 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))); } }.writePackedRefs();
lck.write(content); } catch (IOException ioe) { throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name), ioe); } catch (InterruptedException e) { lck.unlock(); throw new ObjectWritingException(MessageFormat.format(JGitText.get().interruptedWriting, name)); throw new ObjectWritingException(MessageFormat.format(JGitText.get().unableToWrite, name)); p -> p.id.equals(oldPackedList.id) ? newPackedList : p); if (!afterUpdate.id.equals(newPackedList.id)) { throw new ObjectWritingException( MessageFormat.format(JGitText.get().unableToWrite, name));