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

         * @return The normalized URI reference.
         */
        @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

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

         * @return The normalized URI reference.
         */
        @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

            boolean missingPropertyFound = false;
            for (String missingProperty : Sets.difference(allProperties, valueMap.keySet()).immutableCopy()) {
                valueMap.put(missingProperty, MISSING_PROPERTY_PREFIX + missingProperty + MISSING_PROPERTY_SUFFIX);
                missingPropertyFound = true;
            }
            final StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap, propertyPrefix, propertySuffix);
            for (final FileInfo template : templates) {
                generateConfig(template, filter, outputBasePath, strSubstitutor, missingPropertiesByFilename, missingPropertyFound);
            }
        }
View Full Code Here

            boolean missingPropertyFound = false;
            for (String missingProperty : Sets.difference(allProperties, valueMap.keySet()).immutableCopy()) {
                valueMap.put(missingProperty, MISSING_PROPERTY_PREFIX + missingProperty + MISSING_PROPERTY_SUFFIX);
                missingPropertyFound = true;
            }
            final StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap, propertyPrefix, propertySuffix);
            for (final FileInfo template : templates) {
                generateConfig(template, filter, outputBasePath, strSubstitutor, missingPropertiesByFilename, missingPropertyFound);
            }
        }
View Full Code Here

            args.add("-jar");

            args.add(launcherPath);

            String subActions = new StrSubstitutor(env).replace(actions);
            for (String action : split(subActions)) {
                args.add(action);
            }

            if (!launcher.isUnix()) {
View Full Code Here

    return job;
  }

  private void outputMessage(final TemporaryJob job) {
    for (String host : job.hosts()) {
      final StrSubstitutor subst = new StrSubstitutor(new ImmutableMap.Builder<String, Object>()
          .put("host", host)
          .put("name", job.job().getId().getName())
          .put("version", job.job().getId().getVersion())
          .put("hash", job.job().getId().getHash())
          .put("job", job.job().toString())
          .put("containerId", job.statuses().get(host).getContainerId())
          .build()
          );
      log.info("{}", subst.replace(jobDeployedMessageFormat));
    }
  }
View Full Code Here

     */
    private void addJarArgs() throws JsonProcessingException {
        List<String> args = builder.getArgs();

        String[] rawArgs = versionManifest.getMinecraftArguments().split(" +");
        StrSubstitutor substitutor = new StrSubstitutor(getCommandSubstitutions());
        for (String arg : rawArgs) {
            args.add(substitutor.replace(arg));
        }
    }
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.