Skip to content

Instantly share code, notes, and snippets.

View stevez's full-sized avatar

Steve Zhang stevez

  • Markham, Ontario, Canada
View GitHub Profile
public void test_include_singl_file() {
try {
PropertiesConfiguration config = new PropertiesConfiguration(
"config.properties");
PropertiesConfiguration extConfig = (PropertiesConfiguration) config
.interpolatedConfiguration();
Iterator<String> iter = extConfig.getKeys();
while (iter.hasNext()) {
String key = iter.next();
user.name=Amanda Zhu
user.password=8888
#config.properties
user=amanda
include=${user}.properties
connection.string=${user.name}:${user.password}
#amanda.properties
user.name=Amanda Zhu
user.password=8888
/* variable.properties
user.name=steve
user.password=pass
credential.string=${user.name}:${user.password}
*/
public void test_variable_interpolation() {
try {
/* variable.properties
user.name=steve
user.password=pass
credential.string=${user.name}:${user.password}
*/
public void test_variable_interpolation() {
try {
@stevez
stevez / gist:2305725
Created April 4, 2012 21:14
groovy_jira_add_comment
import groovy.json.JsonSlurper
def urlRoot = "https://example.com"
def issueId = ""
def userName = ""
def password = ""
def addr = "${urlRoot}/rest/api/2/issue/${issueId}/comment"
def authString = "${userName}:${password}".getBytes().encodeBase64().toString()
def comment = "added by groovy"
@stevez
stevez / gist:2305629
Created April 4, 2012 21:02
groovy_request_jira_issue
import groovy.json.JsonSlurper
/*
def urlRoot = "https://example.com"
def issueId = ""
def userName = ""
def password = ""
def addr = "${urlRoot}/rest/api/2/issue/${issueId}"
def authString = "${userName}:${password}".getBytes().encodeBase64().toString()
*/
@stevez
stevez / gist:2305626
Created April 4, 2012 21:01
groovy_request_jira_issue
import groovy.json.JsonSlurper
/*
def urlRoot = "https://example.com"
def issueId = ""
def userName = ""
def password = ""
def addr = "${urlRoot}/rest/api/2/issue/${issueId}"
def authString = "${userName}:${password}".getBytes().encodeBase64().toString()
*/
def lib_folder = "libs";
def jarFiles = []
new File(lib_folder).eachFile { file ->
jarFiles << file.name
}
builder = new groovy.xml.StreamingMarkupBuilder()
builder.encoding = "UTF-8"
new XmlNodePrinter().print(classpath)