<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Read # symbol in config.properties in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171532#M50124</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/11188/radhikamantri32.html" nodeid="11188"&gt;@radhika mantri&lt;/A&gt;&lt;P&gt;instead of reading # keys from properties file why don you put null check in your producer or consumer and set this value there like this&lt;/P&gt;&lt;PRE&gt;if (properties.getProperty("#google") == null) {
    properties.setProperty("#google", "google");
}&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Dec 2016 18:20:49 GMT</pubDate>
    <dc:creator>rajkumar_singh</dc:creator>
    <dc:date>2016-12-26T18:20:49Z</dc:date>
    <item>
      <title>Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171531#M50123</link>
      <description>&lt;P&gt;I want to use # symbol in&lt;STRONG&gt; config.properties .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I know that # is used for comment in config.properties but I want to use it as a part of keyword.&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#google=google&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#microsoft=microsoft&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; I need this for getting tweets having&lt;STRONG&gt; hashtag(#)of google.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is this possible?
If yes then how and if no then why?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 17:14:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171531#M50123</guid>
      <dc:creator>radhikamantri32</dc:creator>
      <dc:date>2016-12-26T17:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171532#M50124</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/11188/radhikamantri32.html" nodeid="11188"&gt;@radhika mantri&lt;/A&gt;&lt;P&gt;instead of reading # keys from properties file why don you put null check in your producer or consumer and set this value there like this&lt;/P&gt;&lt;PRE&gt;if (properties.getProperty("#google") == null) {
    properties.setProperty("#google", "google");
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Dec 2016 18:20:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171532#M50124</guid>
      <dc:creator>rajkumar_singh</dc:creator>
      <dc:date>2016-12-26T18:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171533#M50125</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/8919/rajkumarsingh.html" nodeid="8919"&gt;@Rajkumar Singh&lt;/A&gt;
&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;config.properties&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;yahoo=yahoo
google=google&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#google=google(This is actually what I want to do but I know its comment in config.properties file)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Read configuration.class&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public class ReadConfiguration implements Serializable {&lt;/P&gt;&lt;P&gt;   private static ReadConfiguration readConfiguration;
   private static HashMap&amp;lt;String, String&amp;gt; propertyMap;&lt;/P&gt;&lt;P&gt;   public static HashMap&amp;lt;String, String&amp;gt; getPropertyMap() {&lt;/P&gt;&lt;P&gt;     return propertyMap;
   }&lt;/P&gt;&lt;P&gt;private ReadConfiguration() {
   }&lt;/P&gt;&lt;P&gt;   public static synchronized ReadConfiguration getInstance() {
     if (readConfiguration == null) {
       readConfiguration = new ReadConfiguration();
       propertyMap = readConfiguration
           .readConfiguration("/configuration.properties");
   
     }
     return readConfiguration;&lt;/P&gt;&lt;P&gt;   }&lt;/P&gt;&lt;P&gt;   public HashMap&amp;lt;String, String&amp;gt; readConfiguration(String path)
       throws NullPointerException {
     HashMap&amp;lt;String, String&amp;gt; propertyMap = new HashMap&amp;lt;String, String&amp;gt;();&lt;/P&gt;&lt;P&gt;     InputStream input = null;&lt;/P&gt;&lt;P&gt;     try {&lt;/P&gt;&lt;P&gt;       input = ReadConfiguration.class.getResourceAsStream(path);// /configuration&lt;/P&gt;&lt;P&gt;       Properties properties = new Properties();&lt;/P&gt;&lt;P&gt;       properties.load(input);&lt;/P&gt;&lt;P&gt;       Set&amp;lt;String&amp;gt; propertyNames = properties.stringPropertyNames();&lt;/P&gt;&lt;P&gt;       for (String Property : propertyNames) {&lt;/P&gt;&lt;P&gt;         Enumeration&amp;lt;?&amp;gt; e = properties.propertyNames();&lt;/P&gt;&lt;P&gt;         while (e.hasMoreElements()) {
           String key = (String) e.nextElement();&lt;/P&gt;&lt;P&gt;           String value = properties.getProperty(key);&lt;/P&gt;&lt;P&gt;           propertyMap.put(Property, properties.getProperty(Property));
         }
       }
     } catch (IOException ex) {
       ex.printStackTrace();
     }
     return propertyMap;
}
}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;kafka.class&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if (nullHandler.checkNull(tweetAsMap
                   .get(TwitterProcessingPipelineConstants.TEXT)))&lt;/P&gt;&lt;P&gt; {
                 String tweetTextAsString = tweetAsMap.get(
                     "text").toString();&lt;/P&gt;&lt;P&gt; tweetBean.setText(tweetTextAsString);
                 logger.info("The Text --&amp;gt; " + tweetTextAsString);&lt;/P&gt;&lt;P&gt; for (String word : tweetTextAsString
                     .toLowerCase().split(" ")) &lt;/P&gt;&lt;P&gt;{
                                   
                   if (readConfiguration.getInstance()
                       .getPropertyMap().containsKey(word)) &lt;/P&gt;&lt;P&gt;{
                     
                     
                     String companyName = readConfiguration
                         .getPropertyMap().get(word);// &lt;/P&gt;&lt;P&gt;                     tweetBean.setCompanyName(companyName);&lt;/P&gt;&lt;P&gt;break; &lt;/P&gt;&lt;P&gt;}
                   
                 }&lt;/P&gt;&lt;P&gt;This
 is what we have done in read config class we are taking company name 
from config.properties without any special character we are able to get 
the desired output.&lt;STRONG&gt;But as mentioned above for # how I can get the desired output.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 20:12:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171533#M50125</guid>
      <dc:creator>radhikamantri32</dc:creator>
      <dc:date>2016-12-26T20:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171534#M50126</link>
      <description>&lt;P&gt;how many of this type(&lt;STRONG&gt;#google=google&lt;/STRONG&gt;) of property you are going to have in your applicaiton, if these are fews then you can put in your ReadConfiguration while building propertyMap.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 20:32:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171534#M50126</guid>
      <dc:creator>rajkumar_singh</dc:creator>
      <dc:date>2016-12-26T20:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171535#M50127</link>
      <description>&lt;P&gt;for almost  50  different companies I have to use it eg:#google=google,#yahoo=yahoo and so on&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 12:04:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171535#M50127</guid>
      <dc:creator>radhikamantri32</dc:creator>
      <dc:date>2016-12-27T12:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171536#M50128</link>
      <description>&lt;P&gt;Its working properly I have applied this logic&lt;/P&gt;&lt;P&gt;if (readConfiguration.getInstance()
                       .getPropertyMap()
                       .containsKey(word.replace("#", ""))) {
                     String companyName = readConfiguration
                         .getPropertyMap().get(
                             word.replace("#", ""));&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 20:46:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171536#M50128</guid>
      <dc:creator>radhikamantri32</dc:creator>
      <dc:date>2016-12-27T20:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Read # symbol in config.properties</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171537#M50129</link>
      <description>&lt;P&gt;if (readConfiguration.getInstance()
                       .getPropertyMap()
                       .containsKey(word.replace("#", ""))) {
                     String companyName = readConfiguration
                         .getPropertyMap().get(
                             word.replace("#", ""));&lt;/P&gt;&lt;P&gt;This logic is been implemented and getting the desired output.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 20:48:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Read-symbol-in-config-properties/m-p/171537#M50129</guid>
      <dc:creator>radhikamantri32</dc:creator>
      <dc:date>2016-12-27T20:48:06Z</dc:date>
    </item>
  </channel>
</rss>

