Functions used by the rename file/folder names from metadata features in Jaikoz
// -*-javascript-*-
function ifnotempty(value, sep){
return value.length > 0 ? value + sep : '';
}
function ifnotempty2(value1, value2, sep){
return value1.length > 0 ? value1 + sep :value2.length > 0 ? value2 + sep:'' ;
}
function pad(number, length) {
if (number === '') { return '';}
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}