private void copyWildcard ( List < AlluxioURI > srcPaths , AlluxioURI dstPath , boolean recursive ) throws AlluxioException , IOException { URIStatus dstStatus = null ; try { dstStatus = mFileSystem . getStatus ( dstPath ) ; } catch ( FileDoesNotExistException e ) { // if the destination does not exist, it will be created } if ( dstStatus != null && ! dstStatus . isFolder ( ) ) { throw new InvalidPathException ( ExceptionMessage . DESTINATION_CANNOT_BE_FILE . getMessage ( ) ) ; } if ( dstStatus == null ) { mFileSystem . createDirectory ( dstPath ) ; System . out . println ( "Created directory: " + dstPath ) ; } List < String > errorMessages = new ArrayList <> ( ) ; for ( AlluxioURI srcPath : srcPaths ) { try { copy ( srcPath , new AlluxioURI ( dstPath . getScheme ( ) , dstPath . getAuthority ( ) , PathUtils . concatPath ( dstPath . getPath ( ) , srcPath . getName ( ) ) ) , recursive ) ; } catch ( AlluxioException | IOException e ) { errorMessages . add ( e . getMessage ( ) ) ; } } if ( errorMessages . size ( ) != 0 ) { throw new IOException ( Joiner . on ( ' ' ) . join ( errorMessages ) ) ; } }
Copies a list of files or directories specified by srcPaths to the destination specified by dstPath . This method is used when the original source path contains wildcards .