I am trying to download a google analytics data using java. I am using a quick start code provided by google developer guide. I downloaded oauth credential file in json format from the developer console. I also given the json path to program but I am getting error. Please help
public class HelloAnalytics {
// Path to client_secrets.json file downloaded from the Developer's Console.
// The path is relative to HelloAnalytics.java.
private static final String CLIENT_SECRET_JSON_RESOURCE = "ga-data-report-7ac3499541bf.json";
// The directory where the user's credentials will be stored.
private static final File DATA_STORE_DIR = new File(
System.getProperty("user.home"), "store/hello_analytics");
private static final String APPLICATION_NAME = "Hello Analytics";
private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
private static NetHttpTransport httpTransport;
private static FileDataStoreFactory dataStoreFactory;
public static void main(String[] args) {
try {
Analytics analytics = initializeAnalytics();
String profile = getFirstProfileId(analytics);
printResults(getResults(analytics, profile));
} catch (Exception e) {
e.printStackTrace();
}
}