public synchronized GoogleCalendarService getCalendarService ( String accountId ) throws IOException { if ( calendarService == null ) { Credential credential = impl_getStoredCredential ( accountId ) ; if ( credential == null ) { throw new UnsupportedOperationException ( "The account has not been authorized yet!" ) ; } calendarService = new GoogleCalendarService ( impl_createService ( credential ) ) ; } return calendarService ; }
Instances a new calendar service for the given google account user name . This requires previous authorization to get the service so if the user has not granted access to his data this method will start the authorization process automatically ; this attempts to open the login google page in the default browser .