de.gesellix.gradle.debian.tasks.jdeb.ClosureFilenameMapper.groovy Maven / Gradle / Ivy
package de.gesellix.gradle.debian.tasks.jdeb
import org.vafer.jdeb.mapping.Mapper
import org.vafer.jdeb.shaded.commons.compress.archivers.tar.TarArchiveEntry
class ClosureFilenameMapper implements Mapper {
private Closure mapping
ClosureFilenameMapper(Closure mapping) {
this.mapping = mapping
}
@Override
TarArchiveEntry map(TarArchiveEntry e) {
if (mapping != null) {
e.setName(mapping(e.getName()) as String)
}
return e
}
}