Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ import nextflow.script.params.TupleOutParam
import nextflow.script.params.ValueInParam
import nextflow.script.params.ValueOutParam
import nextflow.util.ArrayBag

import nextflow.util.BlankSeparatedList
import nextflow.util.CustomFileAttributesProvider
import nextflow.util.CacheHelper
import nextflow.util.CollectionHelper
import nextflow.util.LockManager
Expand Down Expand Up @@ -1934,7 +1936,15 @@ class TaskProcessor {
final fileParam = param as FileInParam
final normalized = normalizeInputToFiles(val, count, fileParam.isPathQualifier(), batch)
final resolved = expandWildcards( fileParam.getFilePattern(ctx), normalized )
ctx.put( param.name, singleItemOrList(resolved, task.type) )
def blankSeparatedList = singleItemOrList(resolved, task.type)

if ( val instanceof CustomFileAttributesProvider ) {
val.GetCustomFileAttributes(normalized).each { attributeName, attributeVal ->
blankSeparatedList.metaClass.setProperty(attributeName, attributeVal)
}
}

ctx.put( param.name, blankSeparatedList )
count += resolved.size()
for( FileHolder item : resolved ) {
Integer num = allNames.getOrCreate(item.stageName, 0) +1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

package nextflow.util

import java.util.List
import nextflow.file.FileHolder
import java.util.Map
import groovy.transform.CompileStatic

/**
*
*/

@CompileStatic
interface CustomFileAttributesProvider {
Map GetCustomFileAttributes(List<FileHolder> items)
}