code: private void putFileMatches(String local, String remote,
  			FileTransferProgress progress, boolean resume)
  			throws FileNotFoundException, SftpStatusException, SshException,
  			TransferCancelledException {
  
  		String remotePath = resolveRemotePath(remote);
  		// Remote must be a valid remote directory
  
  		SftpFileAttributes attrs = null;
  		try {
  			attrs = stat(remotePath);
  		} catch (SftpStatusException ex) {
  			throw new SftpStatusException(
  					ex.getStatus(),
  					"Remote path '"
  							+ remote
  							+ "' does not exist. It must be a valid directory and must already exist!");
  		}
  
  		if (!attrs.isDirectory())
  			throw new SftpStatusException(
  					SftpStatusException.SSH_FX_NO_SUCH_PATH, "Remote path '"
  							+ remote + "' is not a directory!");
  
  		String[] matchedFiles = matchLocalFiles(local);
  
  		// call put for each matched file
  		// call the correct put method depending on the put method that called
  		// this
  
  		for (int i = 0; i < matchedFiles.length; i++) {
  			// use file exists once added rather than try catch
  			try {
  				put(matchedFiles[i], remotePath, progress, resume);
  			} catch (SftpStatusException ex) {
  				throw new SftpStatusException(ex.getStatus(), "Failed to put "
  						+ matchedFiles[i] + " to " + remote + " ["
  						+ ex.getMessage() + "]");
  			}
  		}
  	}
docs: If RegExpSyntax is set to GlobSyntax or Perl5Syntax then it pattern
  matches the files in the local directory using "local" as a glob or perl5
  Regular Expression. For each matching file put() is called to copy the
  file to the remote directory.
  
  <p>
  If RegExpSyntax is set to NoSyntax then "local" is treated as a filepath
  instead of a regular expression.
  </p>
  
  @param local
  @param progress
  @param streamOrFile
  
  @throws FileNotFoundException
  @throws SftpStatusException
  @throws SshException
  @throws TransferCancelledException