allow a directory to be specified for externalizing resources

Deprecate the version of getExernalizedResource that creates the
file in the system temp dir.