code: public static String getSourceFolder(Resource resource,
  			CopyResourcesMojo copyResourcesMojo, File workspacePlugin)
  			throws ResourceExecutionException {
  
  		String hostname = resource.getUri().getHost();
  		String username = resource.getUsername();
  		String password = resource.getPassword();
  		String remoteSource = resource.getUri().getPath();
  		StringBuilder retval = new StringBuilder(
  				workspacePlugin.getAbsolutePath());
  		PathUtils.addEndingSlashIfNeeded(retval);
  		retval.append(Calendar.getInstance().getTimeInMillis());
  		PathUtils.addEndingSlashIfNeeded(retval);
  
  		try {
  			FileUtils.createIntermediateFolders(retval.toString());
  			copyResourcesMojo.getLog().debug(
  					"IntermediateFolder created : " + retval.toString());
  		} catch (FileNotFoundException e) {
  			throw new ResourceExecutionException(
  					"Error when clone ftp resource : " + resource, e);
  		}
  		String localDestination = retval.toString().concat(remoteSource);
  		try {
  
  			downloadFile(hostname, username, password, remoteSource,
  					localDestination);
  		} catch (Exception e) {
  			throw new ResourceExecutionException("Error when clone into '"
  					+ localDestination + "' ftp resource : " + resource, e);
  		}
  
  		return String.valueOf(retval);
  
  	}
docs: <p>
  recovery of a deposit of clone ftp remote folder locally
  </p>
  
  @param resource
  a resource
  @param copyResourcesMojo
  mojo attach to goal copy
  @param workspacePlugin
  file as workspace where plugin clone git repository
  @return source folder
  @throws ResourceExecutionException