@Test public void generateClientFileInfo() { MutableInodeDirectory inodeDirectory = createInodeDirectory(); String path = "/test/path"; FileInfo info = inodeDirectory.generateClientFileInfo(path); Assert.assertEquals(inodeDirectory.getId(), info.getFileId()); Assert.assertEquals(inodeDirectory.getName(), info.getName()); Assert.assertEquals(path, info.getPath()); Assert.assertEquals("", info.getUfsPath()); Assert.assertEquals(0, info.getLength()); Assert.assertEquals(0, info.getBlockSizeBytes()); Assert.assertEquals(inodeDirectory.getCreationTimeMs(), info.getCreationTimeMs()); Assert.assertTrue(info.isCompleted()); Assert.assertTrue(info.isFolder()); Assert.assertEquals(inodeDirectory.isPinned(), info.isPinned()); Assert.assertFalse(info.isCacheable()); Assert.assertNotNull(info.getBlockIds()); Assert.assertEquals(inodeDirectory.getLastModificationTimeMs(), info.getLastModificationTimeMs()); }
@Override public FileInfo generateClientFileInfo(String path) { FileInfo ret = new FileInfo(); ret.setFileId(getId()); ret.setName(getName()); ret.setPath(path); ret.setBlockSizeBytes(0); ret.setCreationTimeMs(getCreationTimeMs()); ret.setCompleted(true); ret.setFolder(isDirectory()); ret.setPinned(isPinned()); ret.setCacheable(false); ret.setPersisted(isPersisted()); ret.setLastModificationTimeMs(getLastModificationTimeMs()); ret.setLastAccessTimeMs(getLastAccessTimeMs()); ret.setTtl(mTtl); ret.setTtlAction(mTtlAction); ret.setOwner(getOwner()); ret.setGroup(getGroup()); ret.setMode(getMode()); ret.setPersistenceState(getPersistenceState().toString()); ret.setMountPoint(isMountPoint()); ret.setUfsFingerprint(Constants.INVALID_UFS_FINGERPRINT); ret.setAcl(mAcl); ret.setDefaultAcl(mDefaultAcl); ret.setMediumTypes(getMediumTypes()); return ret; }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { @Override public FileInfo generateClientFileInfo(String path) { FileInfo ret = new FileInfo(); ret.setFileId(getId()); ret.setName(getName()); ret.setPath(path); ret.setBlockSizeBytes(0); ret.setCreationTimeMs(getCreationTimeMs()); ret.setCompleted(true); ret.setFolder(isDirectory()); ret.setPinned(isPinned()); ret.setCacheable(false); ret.setPersisted(isPersisted()); ret.setLastModificationTimeMs(getLastModificationTimeMs()); ret.setLastAccessTimeMs(getLastAccessTimeMs()); ret.setTtl(mTtl); ret.setTtlAction(mTtlAction); ret.setOwner(getOwner()); ret.setGroup(getGroup()); ret.setMode(getMode()); ret.setPersistenceState(getPersistenceState().toString()); ret.setMountPoint(isMountPoint()); ret.setUfsFingerprint(Constants.INVALID_UFS_FINGERPRINT); ret.setAcl(mAcl); ret.setDefaultAcl(mDefaultAcl); ret.setMediumTypes(getMediumTypes()); return ret; } }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { @Override public FileInfo generateClientFileInfo(String path) { FileInfo ret = new FileInfo(); ret.setFileId(getId()); ret.setName(getName()); ret.setPath(path); ret.setBlockSizeBytes(0); ret.setCreationTimeMs(getCreationTimeMs()); ret.setCompleted(true); ret.setFolder(isDirectory()); ret.setPinned(isPinned()); ret.setCacheable(false); ret.setPersisted(isPersisted()); ret.setLastModificationTimeMs(getLastModificationTimeMs()); ret.setLastAccessTimeMs(getLastAccessTimeMs()); ret.setTtl(mTtl); ret.setTtlAction(mTtlAction); ret.setOwner(getOwner()); ret.setGroup(getGroup()); ret.setMode(getMode()); ret.setPersistenceState(getPersistenceState().toString()); ret.setMountPoint(isMountPoint()); ret.setUfsFingerprint(Constants.INVALID_UFS_FINGERPRINT); ret.setAcl(mAcl); ret.setDefaultAcl(mDefaultAcl); ret.setMediumTypes(getMediumTypes()); return ret; } private  MutableInodeDirectory(long id); }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { @Override public FileInfo generateClientFileInfo(String path) { FileInfo ret = new FileInfo(); ret.setFileId(getId()); ret.setName(getName()); ret.setPath(path); ret.setBlockSizeBytes(0); ret.setCreationTimeMs(getCreationTimeMs()); ret.setCompleted(true); ret.setFolder(isDirectory()); ret.setPinned(isPinned()); ret.setCacheable(false); ret.setPersisted(isPersisted()); ret.setLastModificationTimeMs(getLastModificationTimeMs()); ret.setLastAccessTimeMs(getLastAccessTimeMs()); ret.setTtl(mTtl); ret.setTtlAction(mTtlAction); ret.setOwner(getOwner()); ret.setGroup(getGroup()); ret.setMode(getMode()); ret.setPersistenceState(getPersistenceState().toString()); ret.setMountPoint(isMountPoint()); ret.setUfsFingerprint(Constants.INVALID_UFS_FINGERPRINT); ret.setAcl(mAcl); ret.setDefaultAcl(mDefaultAcl); ret.setMediumTypes(getMediumTypes()); return ret; } private  MutableInodeDirectory(long id); @Override boolean isMountPoint(); @Override synchronized boolean isDirectChildrenLoaded(); @Override long getChildCount(); @Override DefaultAccessControlList getDefaultACL(); MutableInodeDirectory setMountPoint(boolean mountPoint); synchronized MutableInodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded); MutableInodeDirectory setChildCount(long childCount); @Override MutableInodeDirectory setDefaultACL(DefaultAccessControlList acl); @Override FileInfo generateClientFileInfo(String path); void updateFromEntry(UpdateInodeDirectoryEntry entry); @Override String toString(); static MutableInodeDirectory fromJournalEntry(InodeDirectoryEntry entry); static MutableInodeDirectory create(long id, long parentId, String name,
      CreateDirectoryContext context); @Override JournalEntry toJournalEntry(); @Override JournalEntry toJournalEntry(String path); @Override InodeMeta.Inode toProto(); static MutableInodeDirectory fromProto(InodeOrBuilder inode); }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { @Override public FileInfo generateClientFileInfo(String path) { FileInfo ret = new FileInfo(); ret.setFileId(getId()); ret.setName(getName()); ret.setPath(path); ret.setBlockSizeBytes(0); ret.setCreationTimeMs(getCreationTimeMs()); ret.setCompleted(true); ret.setFolder(isDirectory()); ret.setPinned(isPinned()); ret.setCacheable(false); ret.setPersisted(isPersisted()); ret.setLastModificationTimeMs(getLastModificationTimeMs()); ret.setLastAccessTimeMs(getLastAccessTimeMs()); ret.setTtl(mTtl); ret.setTtlAction(mTtlAction); ret.setOwner(getOwner()); ret.setGroup(getGroup()); ret.setMode(getMode()); ret.setPersistenceState(getPersistenceState().toString()); ret.setMountPoint(isMountPoint()); ret.setUfsFingerprint(Constants.INVALID_UFS_FINGERPRINT); ret.setAcl(mAcl); ret.setDefaultAcl(mDefaultAcl); ret.setMediumTypes(getMediumTypes()); return ret; } private  MutableInodeDirectory(long id); @Override boolean isMountPoint(); @Override synchronized boolean isDirectChildrenLoaded(); @Override long getChildCount(); @Override DefaultAccessControlList getDefaultACL(); MutableInodeDirectory setMountPoint(boolean mountPoint); synchronized MutableInodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded); MutableInodeDirectory setChildCount(long childCount); @Override MutableInodeDirectory setDefaultACL(DefaultAccessControlList acl); @Override FileInfo generateClientFileInfo(String path); void updateFromEntry(UpdateInodeDirectoryEntry entry); @Override String toString(); static MutableInodeDirectory fromJournalEntry(InodeDirectoryEntry entry); static MutableInodeDirectory create(long id, long parentId, String name,
      CreateDirectoryContext context); @Override JournalEntry toJournalEntry(); @Override JournalEntry toJournalEntry(String path); @Override InodeMeta.Inode toProto(); static MutableInodeDirectory fromProto(InodeOrBuilder inode);  }