added resourceToString method to prevent log4j warning