'Write Credentials to file.
Args:
credentials: Credentials, the credentials to store.'

def locked_put(self, credentials):

    self._create_file_if_needed()
    f = open(self._filename, 'wb')
    f.write(credentials.to_json())
    f.close()
