code: public static DirectoryEntry equivalent( FileSystem target, DirectoryEntry directory )
      {
          if ( target.equals( directory.getFileSystem() ) )
          {
              return directory;
          }
          if ( directory.getParent() == null )
          {
              return target.getRoot();
          }
          return new DefaultDirectoryEntry( target, equivalent( target, directory.getParent() ), directory.getName() );
      }
docs: Creates a {@link DefaultDirectoryEntry} that is equivalent to the supplied {@link DirectoryEntry} only in
  the specified target {@link FileSystem}.
  
  @param target    the filesystem.
  @param directory the directory.
  @return a {@link DirectoryEntry} in the target filesystem.
  @since 1.0