Package org.apache.commons.lang.text

Examples of org.apache.commons.lang.text.StrSubstitutor


   */
  public synchronized StrSubstitutor getSubstitutor()
  {
    if (substitutor == null)
    {
      substitutor = new StrSubstitutor(createInterpolator());
    }
    return substitutor;
  }
View Full Code Here


                    // hack "a la" invoker plugin to download dependencies from local repo
                    // and not download from central

                    Map<String, String> values = new HashMap<String, String>( 1 );
                    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

     */
    public synchronized StrSubstitutor getSubstitutor()
    {
        if (substitutor == null)
        {
            substitutor = new StrSubstitutor(createInterpolator());
        }
        return substitutor;
    }
View Full Code Here

     */
    public synchronized StrSubstitutor getSubstitutor()
    {
        if (substitutor == null)
        {
            substitutor = new StrSubstitutor(createInterpolator());
        }
        return substitutor;
    }
View Full Code Here

  }

  @VisibleForTesting
  protected static boolean impliesURI(String privilege, String request) {
    try {
    URI privilegeURI = new URI(new StrSubstitutor(System.getProperties()).replace(privilege));
    URI requestURI = new URI(request);
    if(privilegeURI.getScheme() == null || privilegeURI.getPath() == null) {
      LOGGER.warn("Privilege URI " + request + " is not valid. Either no scheme or no path.");
      return false;
    }
View Full Code Here

                    // hack "a la" invoker plugin to download dependencies from local repo
                    // and not download from central

                    Map<String, String> values = new HashMap<String, String>( 1 );
                    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

  }

  @VisibleForTesting
  protected static boolean impliesURI(String privilege, String request) {
    try {
    URI privilegeURI = new URI(new StrSubstitutor(System.getProperties()).replace(privilege));
    URI requestURI = new URI(request);
    if(privilegeURI.getScheme() == null || privilegeURI.getPath() == null) {
      LOGGER.warn("Privilege URI " + request + " is not valid. Either no scheme or no path.");
      return false;
    }
View Full Code Here

                    // hack "a la" invoker plugin to download dependencies from local repo
                    // and not download from central

                    Map<String, String> values = new HashMap<String, String>( 1 );
                    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

         * @param uriref The URI reference
         * @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

     * @return The String result of the expression.
     */
    public String lookup(String var)
    {
        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

TOP

Related Classes of org.apache.commons.lang.text.StrSubstitutor

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.