/** * Set the cached size (in bytes) of this file. * * @param sz * new cached size of the file, as bytes. */ public void setLength(long sz) { setLength((int) sz); }
/** * adds a new path with the specified stage to the index builder * * @param path * @param p * @param stage * @param lastMod * @param len * @return the entry which was added to the index */ private DirCacheEntry add(byte[] path, CanonicalTreeParser p, int stage, long lastMod, long len) { if (p != null && !p.getEntryFileMode().equals(FileMode.TREE)) { DirCacheEntry e = new DirCacheEntry(path, stage); e.setFileMode(p.getEntryFileMode()); e.setObjectId(p.getEntryObjectId()); e.setLastModified(lastMod); e.setLength(len); builder.add(e); return e; } return null; }
/** * Set the cached size (in bytes) of this file. * * @param sz * new cached size of the file, as bytes. */ public void setLength(final long sz) { setLength((int) sz); }
/** * Set the cached size (in bytes) of this file. * * @param sz * new cached size of the file, as bytes. */ public void setLength(long sz) { setLength((int) sz); }
DirCacheEntry entry = iIter.getDirCacheEntry(); if (entry.isSmudged() && iIter.idEqual(fIter)) { entry.setLength(fIter.getEntryLength()); entry.setLastModified(fIter.getEntryLastModified());
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getRawPath(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
entry.setLength((int) getEntryLength());
dce.setLastModified( nonNullRepo().getFS().lastModified(mergedFile)); dce.setLength((int) mergedFile.length());
final DirCacheEntry entry = new DirCacheEntry( treeWalk.getRawPath()); entry.setLength(wtIter.getEntryLength()); entry.setLastModified(wtIter.getEntryLastModified()); entry.setFileMode(wtIter.getEntryFileMode());
@Override public void apply( final DirCacheEntry ent ) { ent.setLength( pathAndContent.getValue().length() ); ent.setLastModified( pathAndContent.getValue().lastModified() ); ent.setFileMode( REGULAR_FILE ); try { final InputStream inputStream = new FileInputStream( pathAndContent.getValue() ); try { final ObjectId objectId = inserter.insert( Constants.OBJ_BLOB, pathAndContent.getValue().length(), inputStream ); ent.setObjectId( objectId ); } finally { inputStream.close(); } } catch ( final Exception ex ) { throw new RuntimeException( ex ); } } } );
dcEntry.setLength(entryLength); dcEntry.setLastModified(fTree.getEntryLastModified()); dcEntry.setFileMode(fTree.getIndexFileMode(dcTree));
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
/** * adds a new path with the specified stage to the index builder * * @param path * @param p * @param stage * @param lastMod * @param len * @return the entry which was added to the index */ private DirCacheEntry add(byte[] path, CanonicalTreeParser p, int stage, long lastMod, long len) { if (p != null && !p.getEntryFileMode().equals(FileMode.TREE)) { DirCacheEntry e = new DirCacheEntry(path, stage); e.setFileMode(p.getEntryFileMode()); e.setObjectId(p.getEntryObjectId()); e.setLastModified(lastMod); e.setLength(len); builder.add(e); return e; } return null; }
/** * adds a new path with the specified stage to the index builder * * @param path * @param p * @param stage * @param lastMod * @param len * @return the entry which was added to the index */ private DirCacheEntry add(byte[] path, CanonicalTreeParser p, int stage, long lastMod, long len) { if (p != null && !p.getEntryFileMode().equals(FileMode.TREE)) { DirCacheEntry e = new DirCacheEntry(path, stage); e.setFileMode(p.getEntryFileMode()); e.setObjectId(p.getEntryObjectId()); e.setLastModified(lastMod); e.setLength(len); builder.add(e); return e; } return null; }
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getPathString(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getRawPath(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());