public class SimplePropertiesWriter extends DIHProperties
  Writes properties using Properties.store(java.io.Writer, java.lang.String) .
  The special property "last_index_time" is converted to a formatted date.
  Users can configure the location, filename, locale and date format to use.
 
| Modifier and Type | Field and Description | 
|---|---|
| protected String | configDir | 
| static String | DATE_FORMATThe date format to use when writing values for "last_index_time" to the properties file. | 
| protected SimpleDateFormat | dateFormat | 
| static String | DIRECTORYThe directory to save the properties file in. | 
| protected String | filename | 
| static String | FILENAMEThe filename to save the properties file to. | 
| protected Locale | locale | 
| static String | LOCALEThe locale to use when writing the properties file. | 
| Constructor and Description | 
|---|
| SimplePropertiesWriter() | 
| Modifier and Type | Method and Description | 
|---|---|
| String | convertDateToString(Date d) | 
| protected Date | convertStringToDate(String s) | 
| protected void | findDirectory(DataImporter dataImporter,
             Map<String,String> params) | 
| void | init(DataImporter dataImporter,
    Map<String,String> params) | 
| boolean | isWritable() | 
| protected Properties | mapToProperties(Map<String,Object> propObjs)DocBuildersends the date as an Object because 
 this class knows how to convert it to a String | 
| void | persist(Map<String,Object> propObjs) | 
| protected Map<String,Object> | propertiesToMap(Properties p)We'll send everything back as Strings as this class has
 already converted them. | 
| Map<String,Object> | readIndexerProperties() | 
getCurrentTimestampprotected String filename
protected String configDir
protected Locale locale
protected SimpleDateFormat dateFormat
public static final String LOCALE
Locale.ROOTpublic static final String DATE_FORMAT
SimpleDateFormat for patterns.  Default is yyyy-MM-dd HH:mm:ss .public static final String DIRECTORY
public static final String FILENAME
public void init(DataImporter dataImporter, Map<String,String> params)
init in class DIHPropertiesprotected void findDirectory(DataImporter dataImporter, Map<String,String> params)
public boolean isWritable()
isWritable in class DIHPropertiespublic String convertDateToString(Date d)
convertDateToString in class DIHPropertiesprotected Properties mapToProperties(Map<String,Object> propObjs)
DocBuilder sends the date as an Object because 
 this class knows how to convert it to a Stringprotected Map<String,Object> propertiesToMap(Properties p)
public void persist(Map<String,Object> propObjs)
persist in class DIHPropertiespublic Map<String,Object> readIndexerProperties()
readIndexerProperties in class DIHPropertiesCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.