this.basePath = Helper.trim(googleDriveOptions.getClientBasePath(), SEPARATOR);
this.backupName = backupName;
this.historyCount = history;
this.historyName = history > 0 ? backupName + " " + new SimpleDateFormat("yyyy.MM.dd_HH.mm.ss").format(new Date()) : null;
final HttpTransport httpTransport = new NetHttpTransport();
final JsonFactory jsonFactory = new JacksonFactory();
final GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport, jsonFactory, googleDriveOptions.getClientID(), googleDriveOptions.getClientSecret(),
Arrays.asList(DriveScopes.DRIVE)).setAccessType("offline").setApprovalPrompt("auto").build();
this.clientTokenPath = Paths.get(googleDriveOptions.getClientTokenPath());
try {
final String clientTokenAsJson = Files.exists(this.clientTokenPath) ? FileUtils.readFileToString(this.clientTokenPath.toFile()) : null;
credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport()).setJsonFactory(new GsonFactory())
.setClientSecrets(googleDriveOptions.getClientID(), googleDriveOptions.getClientSecret()).build();
if (StringUtils.isEmpty(clientTokenAsJson)) {
final String url = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URL).build();