Package org.codehaus.plexus.util.interpolation

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


                String rawInput = sWriter.toString();

                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );

                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn(
                        "Failed to initialize environment variable resolver. Skipping environment substitution in settings." );
View Full Code Here

            try
            {
                fin = new FileInputStream( propsFile );

                props.load( fin );
                RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                interpolator.addValueSource( new MapBasedValueSource( filter ) );
                for ( Iterator it = props.keySet().iterator(); it.hasNext(); )
                {
                    String key = (String) it.next();
                    String value = props.getProperty( key );
                    value = interpolator.interpolate( value, "" );
                    props.setProperty( key, value );
                }
               
                filter.getProperties().putAll(props);
            }
View Full Code Here

            try
            {
                fin = new FileInputStream( propsFile );

                props.load( fin );
                RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                interpolator.addValueSource( new MapBasedValueSource( filter ) );
                for ( Iterator it = props.keySet().iterator(); it.hasNext(); )
                {
                    String key = (String) it.next();
                    String value = props.getProperty( key );
                    value = interpolator.interpolate( value, "" );
                    props.setProperty( key, value );
                }
               
                filter.getProperties().putAll(props);
            }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.interpolation.RegexBasedInterpolator

Copyright © 2018 www.massapicom. 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.