@Override
 protected Collection<TransferFile> fetchChildren() {
   try {
     return remoteClient.listFiles(this);
   } catch (RemoteException ex) {
     LOGGER.log(Level.INFO, "Error while getting children for " + this, ex);
     RemoteUtils.processRemoteException(ex);
   }
   return Collections.emptyList();
 }
  public RemoteTransferFile(
      RemoteFile file,
      TransferFile parent,
      RemoteClientImplementation remoteClient,
      String baseLocalDirectoryPath) {
    super(parent, baseLocalDirectoryPath, remoteClient.getBaseRemoteDirectory());
    this.file = file;
    this.remoteClient = remoteClient;

    if (file == null) {
      throw new NullPointerException("Remote file cannot be null");
    }
    if (remoteClient == null) {
      throw new NullPointerException("Remote client cannot be null");
    }
    if (!baseRemoteDirectoryPath.startsWith(REMOTE_PATH_SEPARATOR)) {
      throw new IllegalArgumentException(
          "Base directory '"
              + baseRemoteDirectoryPath
              + "' must start with '"
              + REMOTE_PATH_SEPARATOR
              + "'");
    }
    String parentDirectory = getParentDirectory();
    if (!parentDirectory.startsWith(REMOTE_PATH_SEPARATOR)) {
      throw new IllegalArgumentException(
          "Parent directory '"
              + parentDirectory
              + "' must start with '"
              + REMOTE_PATH_SEPARATOR
              + "'");
    }
    checkParentDirectory(baseRemoteDirectoryPath, parentDirectory);
    if (LOGGER.isLoggable(Level.FINE)) {
      // #204874 (non-standard ssh server?)
      LOGGER.log(
          Level.FINE,
          "Absolute remote path \"{0}\" -> remote path \"{1}\" (base directory \"{2}\")",
          new Object[] {getAbsolutePath(), getRemotePath(), baseRemoteDirectoryPath});
    }
  }