The credentials supplier does many things. I'd refactor it in a "delegating credential supplier" and extract the two branches of the conditional into a "FileBasedSupplier" and an "InMemorySupplier". Inject both suppliers into the delegating one and pick the right one based on the type of the provided credentials.
--- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/153#issuecomment-88231328
