Package org.apache.commons.lang.text

Examples of org.apache.commons.lang.text.StrSubstitutor.replace()


                    values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
                    StrSubstitutor strSubstitutor = new StrSubstitutor( values );

                    String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );

                    String filtered = strSubstitutor.replace( fileContent );

                    FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );

                }
View Full Code Here


                    values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
                    StrSubstitutor strSubstitutor = new StrSubstitutor( values );

                    String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );

                    String filtered = strSubstitutor.replace( fileContent );

                    FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );

                }
View Full Code Here

                    values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
                    StrSubstitutor strSubstitutor = new StrSubstitutor( values );

                    String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );

                    String filtered = strSubstitutor.replace( fileContent );

                    FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );

                }
View Full Code Here

         * @return The normalized URI reference.
         */
        protected String normalizeURI(String uriref)
        {
            StrSubstitutor substitutor = ((CatalogManager) catalogManager).getStrSubstitutor();
            String resolved = substitutor != null ? substitutor.replace(uriref) : uriref;
            return super.normalizeURI(resolved);
        }
    }
}
View Full Code Here

    {
        ConfigurationInterpolator interp = configuration.getInterpolator();
        StrSubstitutor subst = new StrSubstitutor(interp, prefixMatcher, suffixMatcher,
                StrSubstitutor.DEFAULT_ESCAPE);

        String result = subst.replace(var);

        try
        {
            Expression exp = ExpressionFactory.createExpression(result);
            result = (String) exp.evaluate(context);
View Full Code Here

     */
    private File getFstDirectory(SolrCore core, String fstFolderConfig) {
        StrSubstitutor substitutor = new StrSubstitutor(new SolrCoreStrLookup(
            indexReference, core, bundleContext));
        substitutor.setEnableSubstitutionInVariables(true);
        String folderStr = substitutor.replace(fstFolderConfig);
        if(folderStr.indexOf("${") > 0){
            folderStr = substitutor.replace(folderStr);
        }
        //convert separators to the current OS
        folderStr = FilenameUtils.separatorsToSystem(folderStr);
View Full Code Here

        StrSubstitutor substitutor = new StrSubstitutor(new SolrCoreStrLookup(
            indexReference, core, bundleContext));
        substitutor.setEnableSubstitutionInVariables(true);
        String folderStr = substitutor.replace(fstFolderConfig);
        if(folderStr.indexOf("${") > 0){
            folderStr = substitutor.replace(folderStr);
        }
        //convert separators to the current OS
        folderStr = FilenameUtils.separatorsToSystem(folderStr);
        File fstDir = new File(folderStr);
        if(!fstDir.isDirectory()){ //create the FST directory
View Full Code Here

  public InputStream open( String path ) throws IOException
  {
    String config = convertStreamToString( baseProvider.open( path ) );
    StrSubstitutor environmentVariableSubstitutor = strSubstitutor;

    String substitutedConfig = environmentVariableSubstitutor.replace( config );
    return new ByteArrayInputStream( substitutedConfig.getBytes() );
  }

  static String convertStreamToString( InputStream is )
  {
View Full Code Here

                    values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
                    StrSubstitutor strSubstitutor = new StrSubstitutor( values );

                    String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );

                    String filtered = strSubstitutor.replace( fileContent );

                    FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );

                }
View Full Code Here

         */
        @Override
        protected String normalizeURI(String uriref)
        {
            StrSubstitutor substitutor = ((CatalogManager) catalogManager).getStrSubstitutor();
            String resolved = substitutor != null ? substitutor.replace(uriref) : uriref;
            return super.normalizeURI(resolved);
        }
    }
}
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.