Yes, that will work. The java.io.tmpdir fallback you have will cover unit tests and the like that may not have that property set.