I have some files that I need to copy to a directory configured in the .cfg file as part of installing the bundle in Karaf server. I couldn't figure out what exactly is the js method to invoke. Below id the snippet I used to extract a jar using postProcess in metatype.js, but how do I copy a file..
var postProcess = function(group, map ) {
if(map["destination.script.path"] && map["destination.script.path"].trim()!='') {
scope.installTasks.expandResources(java.lang.System.getProperty('karaf.base') +"/data/hrc/install/source/resources.jar",map["destination.script.path"]+"/scripts",false,
function(key,success) {
print("expanded " + success);
},
function(key,fail){
print(fail.getMessage());
});
}
};
var success = function(source,val){
//print(val);
}
var fail = function(source,e){
//print(source);
}
This is how my OSGI-INF looks like

Sorry, installTasks is an internal utility used in my project.