org.jenkinsci.plugins.ivytrigger.util
Class PropertiesFileContentExtractor

java.lang.Object
  extended by org.jenkinsci.plugins.ivytrigger.util.PropertiesFileContentExtractor

public class PropertiesFileContentExtractor
extends Object

Author:
Mike McLean

Constructor Summary
PropertiesFileContentExtractor(FilePathFactory filePathFactory)
           
 
Method Summary
 String extractPropertiesFileContents(String propertiesFilePath, hudson.model.AbstractProject job, hudson.model.Node pollingNode, org.jenkinsci.lib.xtrigger.XTriggerLog log, Map<String,String> envVars)
          Given a propertiesFilePath value, will split that value into multiple paths, read the content from the resolved file names and return the content.
 List<String> splitFilePaths(String propertiesFilePath)
          Utility method that: 1) Splits the value on semi-colon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesFileContentExtractor

public PropertiesFileContentExtractor(FilePathFactory filePathFactory)
Method Detail

extractPropertiesFileContents

public String extractPropertiesFileContents(String propertiesFilePath,
                                            hudson.model.AbstractProject job,
                                            hudson.model.Node pollingNode,
                                            org.jenkinsci.lib.xtrigger.XTriggerLog log,
                                            Map<String,String> envVars)
                                     throws org.jenkinsci.lib.xtrigger.XTriggerException
Given a propertiesFilePath value, will split that value into multiple paths, read the content from the resolved file names and return the content.

The content of the property files is assumed to be in properties file format. e.g.: prop1=1 prop2=2 prop3=3

As an example, if the propertiesFilePath is "a.properties;b.properties", that a.properties contains prop1=2 and that b.properties contains prop2=3, the method will return: prop1=2 prop2=3

Parameters:
propertiesFilePath - If this value is empty or null, the method will return an empty string.
Returns:
The aggregated content of the properties files
Throws:
org.jenkinsci.lib.xtrigger.XTriggerException

splitFilePaths

public List<String> splitFilePaths(String propertiesFilePath)
Utility method that: 1) Splits the value on semi-colon. Right now, this is a hard coded value. Could probably be refactored to use a configurable value 2) Trims the values 3) Returns a list of the fixed up values.



Copyright © 2004-2012. All Rights Reserved.