question: private List < Map < String , Object > > globFiles ( final SBJob job , final File workingDir , HashAlgorithm hashAlgorithm , final SBOutputPort outputPort , Object outputBinding ) throws SBGlobException { if ( outputPort . getOutputBinding ( ) != null ) { outputBinding = outputPort . getOutputBinding ( ) ; } if ( outputBinding == null ) { logger . debug ( "Output binding is empty. Skip output extraction." ) ; return null ; } Object glob = SBBindingHelper . getGlob ( outputBinding ) ; if ( glob == null ) { logger . debug ( "GLOB does not exist. Skip output extraction." ) ; return null ; } Set < File > paths = globService . glob ( job , workingDir , glob ) ; if ( paths == null ) { logger . info ( "Glob service didn't find any files." ) ; return null ; } logger . debug ( "Glob service returned result {}" , paths ) ; final List < Map < String , Object > > result = new ArrayList < > ( ) ; for ( File path : paths ) { try { logger . info ( "Processing {}." , path ) ; File file = path ; Map < String , Object > fileData = new HashMap < > ( ) ; SBFileValueHelper . setFileType ( fileData ) ; if ( hashAlgorithm != null ) { SBFileValueHelper . setChecksum ( file , fileData , hashAlgorithm ) ; } SBFileValueHelper . setSize ( file . length ( ) , fileData ) ; SBFileValueHelper . setName ( file . getName ( ) , fileData ) ; SBFileValueHelper . setPath ( file . getAbsolutePath ( ) , fileData ) ; List < ? > secondaryFiles = getSecondaryFiles ( job , hashAlgorithm , fileData , file . getAbsolutePath ( ) , outputBinding ) ; if ( secondaryFiles != null ) { SBFileValueHelper . setSecondaryFiles ( secondaryFiles , fileData ) ; } Object metadata = SBBindingHelper . getMetadata ( outputBinding ) ; metadata = metadataService . evaluateMetadataExpressions ( job , fileData , metadata ) ; logger . info ( "Metadata expressions evaluated. Metadata is {}." , metadata ) ; if ( metadata != null ) { SBFileValueHelper . setMetadata ( metadata , fileData ) ; } metadata = metadataService . processMetadata ( job , fileData , outputPort , outputBinding ) ; if ( metadata != null ) { logger . info ( "Metadata for {} resolved. Metadata is {}" , outputPort . getId ( ) , metadata ) ; SBFileValueHelper . setMetadata ( metadata , fileData ) ; } else { logger . info ( "Metadata for {} output is empty." , outputPort . getId ( ) ) ; } result . add ( fileData ) ; boolean loadContents = SBBindingHelper . loadContents ( outputBinding ) ; if ( loadContents ) { SBFileValueHelper . setContents ( fileData ) ; } } catch ( Exception e ) { logger . error ( "Failed to extract outputs" , e ) ; throw new SBGlobException ( "Failed to extract outputs." , e ) ; } } return result ; }
target:  Extracts files from a directory based on GLOB expression