@Override public FileTime lastModifiedTime() { if (records.size() > 0) { return new FileTimeImpl(records.get(records.size() - 1).date().getTime()); } return null; }
@Override public int compareTo(final FileTime o) { checkNotNull("o", o); final long thisVal = this.toMillis(); final long anotherVal = o.toMillis(); return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); } }
@Override public int compareTo(final FileTime o) { checkNotNull("o", o); final long thisVal = this.toMillis(); final long anotherVal = o.toMillis(); return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); } }
@Override public FileTime creationTime() { if (records.size() > 0) { return new FileTimeImpl(records.get(0).date().getTime()); } return null; }
@Override public <T extends BasicFileAttributes> T readAttributes() throws IOException { if (attrs == null) { final File file = path.toFile(); this.attrs = new BasicFileAttributesImpl(path.toString(), new FileTimeImpl(file.lastModified()), null, null, new LazyAttrLoader<Long>() { private Long size = null; @Override public Long get() { if (size == null) { size = file.length(); } return size; } }, file.isFile(), file.isDirectory()); } return (T) attrs; }
@Override public FileTime lastModifiedTime() { if (lastModifiedDate == null) { try { lastModifiedDate = new FileTimeImpl(fs.getGit().getLastCommit(ref).getCommitterIdent().getWhen().getTime()); } catch (final Exception e) { lastModifiedDate = new FileTimeImpl(0); } } return lastModifiedDate; }
@Override public <T extends BasicFileAttributes> T readAttributes() throws IOException { if (attrs == null) { final File file = path.toFile(); this.attrs = new BasicFileAttributesImpl(path.toString(), new FileTimeImpl(file.lastModified()), null, null, new LazyAttrLoader<Long>() { private Long size = null; @Override public Long get() { if (size == null) { size = file.length(); } return size; } }, file.isFile(), file.isDirectory()); } return (T) attrs; }
@Override public FileTime creationTime() { if (creationDate == null) { try { creationDate = new FileTimeImpl(fs.getGit().getFirstCommit(ref).getCommitterIdent().getWhen().getTime()); } catch (final Exception e) { creationDate = new FileTimeImpl(0); } } return creationDate; }