code: private SftpFile[] getFileMatches(String remote, String local,
  			FileTransferProgress progress, boolean resume)
  			throws FileNotFoundException, SftpStatusException, SshException,
  			TransferCancelledException {
  
  		// match with files using remote as regular expression.
  		SftpFile[] matchedFiles = matchRemoteFiles(remote);
  
  		Vector<SftpFile> retrievedFiles = new Vector<SftpFile>();
  		// call get for each matched file, append the files attributes to a
  		// vector to be returned at the end
  		// call the correct get method depending on the get method that called
  		// this
  		for (int i = 0; i < matchedFiles.length; i++) {
  			get(matchedFiles[i].getAbsolutePath(), local, progress, resume);
  			retrievedFiles.addElement(matchedFiles[i]);
  		}
  
  		// return (SftpFile[]) retrievedFiles.toArray(new SftpFile[0]);
  		SftpFile[] retrievedSftpFiles = new SftpFile[retrievedFiles.size()];
  		retrievedFiles.copyInto(retrievedSftpFiles);
  		return retrievedSftpFiles;
  	}
docs: If RegExpSyntax is set to GlobSyntax or Perl5Syntax then it pattern
  matches the files in the remote directory using "remote" as a glob or
  perl5 Regular Expression. For each matching file get() is called to copy
  the file to the local directory.
  
  <p>
  If RegExpSyntax is set to NoSyntax then "remote" is treated as a filepath
  instead of a regular expression
  </p>
  
  @param remote
  @param progress
  @param streamOrFile
  @return SftpFile[] of SftpFile's that have been retrieved
  @throws FileNotFoundException
  @throws SftpStatusException
  @throws SshException
  @throws TransferCancelledException