public KieFileSystem write(Resource resource) {
try {
String target = resource.getTargetPath() != null ? resource.getTargetPath() : resource.getSourcePath();
if( target != null ) {
write( RESOURCE_PATH_PREFIX+target, readBytesFromInputStream(resource.getInputStream()) );
ResourceConfiguration conf = resource.getConfiguration();
if( conf != null ) {
Properties prop = ResourceTypeImpl.toProperties( conf );
ByteArrayOutputStream buff = new ByteArrayOutputStream();
prop.store( buff, "Configuration properties for resource: "+target );
write( RESOURCE_PATH_PREFIX+target+".properties", buff.toByteArray() );