public static Authorization getAuth() { if (instance == null) instance = new Authorization(); return instance; }
private static Credential authorize(GuildSettings g) throws Exception { if (g.getEncryptedAccessToken().equalsIgnoreCase("N/a")) throw new IllegalAccessException("Guild does not have proper access token!"); AESEncryption encryption = new AESEncryption(g); String accessToken = Authorization.getAuth().requestNewAccessToken(g, encryption); GoogleCredential credential = new GoogleCredential(); credential.setAccessToken(accessToken); return credential; }