Example usage for org.springframework.util StringUtils arrayToCommaDelimitedString

List of usage examples for org.springframework.util StringUtils arrayToCommaDelimitedString

Introduction

In this page you can find the example usage for org.springframework.util StringUtils arrayToCommaDelimitedString.

Prototype

public static String arrayToCommaDelimitedString(@Nullable Object[] arr) 

Source Link

Document

Convert a String array into a comma delimited String (i.e., CSV).

Usage

From source file:org.tdmx.server.runtime.ServerLauncher.java

public static void main(String[] args) {
    String javaVersion = System.getProperty("java.version");

    StringTokenizer tokens = new StringTokenizer(javaVersion, ".-_");

    int majorVersion = Integer.parseInt(tokens.nextToken());
    int minorVersion = Integer.parseInt(tokens.nextToken());

    if (majorVersion < 2 && minorVersion < 7) {
        log.error("TDMX-Server requires Java 7 or later.");
        log.error("Your java version is " + javaVersion);
        log.error("Java Home:  " + System.getProperty("java.home"));
        System.exit(-1);/*from w  ww.  jav a2  s  .co  m*/
    }

    // Construct the SpringApplication
    BeanFactoryLocator beanFactoryLocator = ContextSingletonBeanFactoryLocator.getInstance();
    BeanFactoryReference beanFactoryReference = beanFactoryLocator.useBeanFactory("applicationContext");
    ApplicationContext context = (ApplicationContext) beanFactoryReference.getFactory();

    SslServerSocketInfo si = (SslServerSocketInfo) context.getBean("server.sslInfo");
    log.info("JVM supportedCipherSuites: "
            + StringUtils.arrayToCommaDelimitedString(si.getSupportedCipherSuites()));
    log.info("JVM supportedProtocols: " + StringUtils.arrayToCommaDelimitedString(si.getSupportedProtocols()));
    log.info("default TrustManagerFactoryAlgorithm: " + si.getDefaultTrustManagerFactoryAlgorithm());

    // Start the Jetty
    ServerContainer sc = (ServerContainer) context.getBean("server.Container");
    sc.runUntilStopped();
}

From source file:com.greglturnquist.spring.social.ecobee.api.Selection.java

public static Selection thermostats(String... thermostatIds) {
    return new Selection(
            new SelectionType("thermostats", StringUtils.arrayToCommaDelimitedString(thermostatIds)));
}

From source file:com.greglturnquist.spring.social.ecobee.api.ReportSelection.java

public static ReportSelection thermostats(String... thermostatIds) {
    return new ReportSelection(
            new SelectionType("thermostats", StringUtils.arrayToCommaDelimitedString(thermostatIds)));
}

From source file:org.wallride.autoconfigure.CacheKeyGenerator.java

@Override
public Object generate(Object target, Method method, Object... params) {
    return method.toString() + " [" + StringUtils.arrayToCommaDelimitedString(params) + "]";
}

From source file:org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializerTest.java

@Test
public void onStartup() {
    this.servletContainerInitializer.onStartup(null, this.servletContext);

    verify(this.servletContext).setInitParameter("globalInitializerClasses",
            StringUtils.arrayToCommaDelimitedString(
                    new String[] { CloudProfileApplicationContextInitializer.class.getCanonicalName(),
                            CloudPropertySourceApplicationContextInitializer.class.getCanonicalName(),
                            CloudAutoReconfigurationApplicationContextInitializer.class.getCanonicalName() }));
}

From source file:com.enonic.cms.server.service.portal.mvc.controller.XmlWebApplicationContextLoader.java

public final ConfigurableApplicationContext loadContext(String... locations) throws Exception {
    if (logger.isDebugEnabled()) {
        logger.debug("Loading ApplicationContext for locations ["
                + StringUtils.arrayToCommaDelimitedString(locations) + "].");
    }/*from  w  w  w.ja v  a  2s . co  m*/
    GenericApplicationContext context = new GenericWebApplicationContext();
    prepareContext(context);
    customizeBeanFactory(context.getDefaultListableBeanFactory());
    createBeanDefinitionReader(context).loadBeanDefinitions(locations);
    AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
    customizeContext(context);
    context.refresh();
    context.registerShutdownHook();
    return context;
}

From source file:org.codehaus.mojo.hibernate3.processor.DefaultProcessor.java

public DefaultProcessor() throws Throwable {
    List<String> clzzNames = new ArrayList<String>();

    Class[] processorsArr = { Asl2LicenseProcessor.class, RequiredImportProcessor.class,
            DateCreatedProcessor.class, DateModifiedProcessor.class, VersionProcessor.class,
            GeneratedValueIdProcessor.class, NonPrimitiveIdProcessor.class//,
            //                                        CacheProcessor.class
    };//w  w  w . j  a va  2 s.  c o  m
    for (Class c : processorsArr) {
        clzzNames.add(c.getName());
    }

    String cds = StringUtils.arrayToCommaDelimitedString(clzzNames.toArray());
    this.processors = ProcessorUtil.buildProcessorsFromProperty(",", cds);
}

From source file:io.pivotal.xd.chaoslemur.RandomFateEngine.java

@Autowired
RandomFateEngine(@Value("${blacklist:}") String[] blacklist,
        @Value("${default.probability:0.2}") Float defaultProbability, Environment environment, Random random) {
    this.blacklist = blacklist;
    this.defaultProbability = defaultProbability.toString();
    this.environment = environment;
    this.random = random;

    this.logger.info("Blacklist: {}", StringUtils.arrayToCommaDelimitedString(blacklist));
    this.logger.info("Default probability: {}", defaultProbability);
}

From source file:org.zilverline.web.IndexController.java

/**
 * Handles form submission by indexing given collections.
 * /*  w w w.  ja  va 2s .  c  o  m*/
 * @param command the CollectionForm
 * 
 * @return ModelAndView the view with updated model
 * 
 * @throws ServletException on Indexing error
 */
public ModelAndView onSubmit(Object command) throws ServletException {
    String[] colNames = ((CollectionForm) command).getNames();
    boolean fullIndex = ((CollectionForm) command).getFullIndex();
    String cols = StringUtils.arrayToCommaDelimitedString(colNames);

    log.debug("Form called with " + cols + ", reindexing: " + fullIndex);

    try {
        indexService.doIndex(colNames, fullIndex);
    } catch (IndexException e) {
        throw new ServletException("Can't index collections " + cols, e);
    }

    log.debug("returning from CollectionForm to view:  " + getSuccessView() + " with " + cols);

    return new ModelAndView(getSuccessView(), "collections", getCollectionManager().getCollections());
}

From source file:com.appleframework.security.auth.token.DefaultUserAuthenticationConverter.java

/**
 * Default value for authorities if an Authentication is being created and the input has no data for authorities.
 * Note that unless this property is set, the default Authentication created by {@link #extractAuthentication(Map)}
 * will be unauthenticated.// w w w.  j a v a  2s .  c  o m
 * 
 * @param defaultAuthorities the defaultAuthorities to set. Default null.
 */
public void setDefaultAuthorities(String[] defaultAuthorities) {
    this.defaultAuthorities = AuthorityUtils
            .commaSeparatedStringToAuthorityList(StringUtils.arrayToCommaDelimitedString(defaultAuthorities));
}