New SaveResource return function

Little extend for saveResource, javadoc also added.