Example usage for java.util Properties get

List of usage examples for java.util Properties get

Introduction

In this page you can find the example usage for java.util Properties get.

Prototype

@Override
    public Object get(Object key) 

Source Link

Usage

From source file:de.iritgo.aktario.betwixt.command.SaveBetwixtBean.java

/**
 * Set the command Properties/*  www .j  a va 2 s .  co  m*/
 *
 * @param properties The properties.
 */
@Override
public void setProperties(Properties properties) {
    bean = (Object) properties.get("bean");

    path = (String) properties.get("path");

    if (path == null) {
        path = Engine.instance().getSystemDir() + Engine.instance().getFileSeparator();
    }

    filename = (String) properties.get("filename");

    if (filename == null) {
        filename = bean.getClass().getName();
    }
}

From source file:com.github.pires.example.hibernate.user.types.JSONBUserType.java

@Override
public void setParameterValues(Properties parameters) {
    final String clazz = (String) parameters.get(CLASS);
    try {//from  w w  w . j a  v a 2s .  c  o  m
        returnedClass = ReflectHelper.classForName(clazz);
    } catch (ClassNotFoundException e) {
        throw new IllegalArgumentException("Class: " + clazz + " is not a known class type.");
    }
}

From source file:com.agiletec.plugins.jpcrowdsourcing.aps.system.services.common.api.CollaborationAbstractApiInterface.java

/**
 * Extract from the api properties the group codes of the user
 * @param properties the api properties/*from w  w  w  . jav a 2 s. co m*/
 * @return the user's groups list
 */
protected Set<String> extractGroups(Properties properties) {
    UserDetails user = (UserDetails) properties.get(SystemConstants.API_USER_PARAMETER);
    return this.extractGroups(user);
}

From source file:org.excalibur.aqmp.handler.QueueStatsProcessor.java

protected Integer getIntegerQueuePropertyValue(String queueName, String propertyName, Integer defaultValue) {
    Properties properties = admin_.getQueueProperties(queueName);

    return properties != null ? properties.get(propertyName) == null ? defaultValue
            : Integer.parseInt(properties.getProperty(propertyName)) : null;
}

From source file:com.dc.tes.adapter.startup.remote.StartUpRemoteForReply.java

public StartUpRemoteForReply(Properties prop) throws Exception {
    if (!((String) prop.get("adapterType")).toUpperCase().equals("REPLY"))
        throw new Exception("??" + prop.get("adapterType") + "?!");

    m_props = prop;// ww w  .  j  av  a2 s.  com
}

From source file:es.tid.fiware.rss.exceptionhandles.RssExceptionMapperTest.java

/**
 * /*w  w  w.j  ava2s.c o  m*/
 */
@Test
public void toResponseJson() throws Exception {
    RssExceptionMapper mapper = new RssExceptionMapper();
    UriInfo mockUriInfo = Mockito.mock(UriInfo.class);
    Mockito.when(mockUriInfo.getAbsolutePath()).thenReturn(new URI("http://www.test.com/go"));
    ReflectionTestUtils.setField(mapper, "uriInfo", mockUriInfo);

    Properties rssProps = Mockito.mock(Properties.class);
    Mockito.when(rssProps.get("service.url")).thenReturn("");
    ReflectionTestUtils.setField(mapper, "rssProps", rssProps);

    HttpHeaders headers = Mockito.mock(HttpHeaders.class);
    Mockito.when(headers.getAcceptableMediaTypes()).thenReturn(Arrays.asList(MediaType.APPLICATION_JSON_TYPE));
    ReflectionTestUtils.setField(mapper, "headers", headers);

    RSSException e = new RSSException("RssException");
    Response response = mapper.toResponse(e);
}

From source file:com.dc.tes.adapter.startup.remote.StartUpRemoteForRequest.java

public StartUpRemoteForRequest(Properties prop) throws Exception {
    if (!((String) prop.get("adapterType")).toUpperCase().equals("REQUEST"))
        throw new Exception("?" + prop.get("adapterType") + "?!");
    m_props = prop;/*  w w w  .  j  a v  a 2s . c om*/
}

From source file:com.wipro.ats.bdre.clustermigration.SourceStageLoad.java

public String getSourceHiveConnection(String pid, String configGroup) {
    GetProperties getProperties = new GetProperties();
    java.util.Properties listForParams = getProperties.getProperties(pid, configGroup);
    return listForParams.get("src-hive").toString();

}

From source file:com.cloud.utils.PropertiesUtilsTest.java

@Test
public void loadFromFile() throws IOException {
    File file = File.createTempFile("test", ".properties");
    FileUtils.writeStringToFile(file, "a=b\nc=d\n");
    Properties properties = new Properties();
    PropertiesUtil.loadFromFile(properties, file);
    Assert.assertEquals("b", properties.get("a"));
}

From source file:com.berkgokden.mongodb.MongoMapStore.java

public void init(HazelcastInstance hazelcastInstance, Properties properties, String mapName) {
    if (properties.get("collection") != null) {
        this.mapName = (String) properties.get("collection");
    } else {//  w  w  w.  ja  v a  2  s .  c  o m
        this.mapName = mapName;
    }
    this.coll = mongoTemplate.getCollection(this.mapName);
    this.converter = new SpringMongoDBConverter(mongoTemplate);
}