Пример #1
0
 /**
  * Converts the entry to an {@link InodeDirectory}.
  *
  * @return the {@link InodeDirectory} representation
  */
 public static InodeDirectory fromJournalEntry(InodeDirectoryEntry entry) {
   PermissionStatus permissionStatus =
       new PermissionStatus(
           entry.getUserName(), entry.getGroupName(), (short) entry.getPermission());
   InodeDirectory inode =
       new InodeDirectory.Builder()
           .setName(entry.getName())
           .setId(entry.getId())
           .setParentId(entry.getParentId())
           .setCreationTimeMs(entry.getCreationTimeMs())
           .setPersisted(entry.getPersisted())
           .setPinned(entry.getPinned())
           .setLastModificationTimeMs(entry.getLastModificationTimeMs())
           .setPermissionStatus(permissionStatus)
           .build();
   return inode;
 }
Пример #2
0
 @Override
 public synchronized JournalEntry toJournalEntry() {
   InodeDirectoryEntry inodeDirectory =
       InodeDirectoryEntry.newBuilder()
           .setCreationTimeMs(getCreationTimeMs())
           .setId(getId())
           .setName(getName())
           .setParentId(getParentId())
           .setPersisted(isPersisted())
           .setPinned(isPinned())
           .setLastModificationTimeMs(getLastModificationTimeMs())
           .setUserName(getUserName())
           .setGroupName(getGroupName())
           .setPermission(getPermission())
           .build();
   return JournalEntry.newBuilder().setInodeDirectory(inodeDirectory).build();
 }