}
@SuppressWarnings( "unchecked" )
private MavenFileFilterRequest setupRequest( Resource resource, File source, File file )
{
MavenFileFilterRequest req = new MavenFileFilterRequest();
req.setFrom( source );
req.setTo( file );
req.setFiltering( resource.isFiltering() );
req.setMavenProject( project );
req.setMavenSession( mavenSession );
req.setInjectProjectBuildFilters( true );
if ( encoding != null )
{
req.setEncoding( encoding );
}
if ( filterDelimiters != null && !filterDelimiters.isEmpty() )
{
LinkedHashSet<String> delims = new LinkedHashSet<String>();
if ( useDefaultFilterDelimiters )
{
delims.addAll( req.getDelimiters() );
}
for ( String delim : filterDelimiters )
{
if ( delim == null )
{
delims.add( "${*}" );
}
else
{
delims.add( delim );
}
}
req.setDelimiters( delims );
}
return req;
}