Examples of RegexBasedInterpolator


Examples of org.codehaus.plexus.util.interpolation.RegexBasedInterpolator

        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 ) )
            {
                fileString = StringUtils.replace( interpolator.interpolate( 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 ) )
            {
                fileString = StringUtils.replace( interpolator.interpolate( fileString, "" ), "\\", "/" );
                return !FileUtils.fileExists( fileString );
            }
        }

        return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.