My integration with Google tables worked successfully for half a year, but today it stopped because of an error java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
has anyone encountered such an error?
private static Credential authorize() throws IOException, GeneralSecurityException {
InputStream in = SheetsHelper.class.getResourceAsStream("/credentials.json");
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JacksonFactory.getDefaultInstance(), new InputStreamReader(in));
List<String> scopes = Arrays.asList(SheetsScopes.SPREADSHEETS);
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(),
clientSecrets, scopes
).setDataStoreFactory(new FileDataStoreFactory(new java.io.File("tokens"))).setAccessType("offline")//<--the error is here
.build();
Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
return credential;
}