if ( actFile != null )
{
// check if the file exists, if it does then the profile will be active
String fileString = actFile.getExists();
RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
try
{
interpolator.addValueSource( new EnvarBasedValueSource() );
}
catch ( IOException e )
{
// ignored
}
interpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) );
if ( StringUtils.isNotEmpty( fileString ) )
{
try
{
fileString = interpolator.interpolate( fileString, "" );
}
catch ( InterpolationException e )
{
getLogger().debug( "Failed to interpolate path in file profile activator: " + fileString, e );
}
fileString = StringUtils.replace( fileString, "\\", "/" );
return FileUtils.fileExists( fileString );
}
// check if the file is missing, if it is then the profile will be active
fileString = actFile.getMissing();
if ( StringUtils.isNotEmpty( fileString ) )
{
try
{
fileString = interpolator.interpolate( fileString, "" );
}
catch ( InterpolationException e )
{
getLogger().debug( "Failed to interpolate path in file profile activator: " + fileString, e );
}