Same error, on windows 7 and java 1.7
Il giorno giovedì 27 settembre 2012 21:10:52 UTC+2, Duke Cvar ha scritto:I'm getting this too. I looked at the class that's throwing this and here's the offending chunk of code:
// set file permissions to be only readable by user if (!file.setReadable(false, false) || !file.setWritable(false, false)
|| !file.setExecutable(false, false) || !file.setReadable(true)
|| !file.setWritable(true)) {
throw new IOException("unable to set file permissions");
} I believe, in my case, that java 6 can't change read & exe permissions on Windows 7. The following methods fail even when I run them as administrator: file.setReadable(boolean) file.setReadable(boolean, boolean) file.setExecutable(boolean) file.setExecutable(boolean, boolean) Any advise from Google or others on how to run this on Windows?
On Monday, September 10, 2012 3:49:26 AM UTC-6, Veerabhadraiah as wrote:Hi All,I downloaded the OAuth 2 sample code from http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg/oauth2-cmdline-sample, and created the project in eclipse. Now when i try to run the project it says 'unable to set file permissions' at FileCredentialStore credentialStore = new FileCredentialStore(new File(System.getProperty("user.home"), ".credentials/oauth2.json"), JSON_FACTORY);// set up authorization code flowGoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES).setCredentialStore(credentialStore).build();Has anyone got this error earlier? What is the solutions for this?
// disable access by other users if O/S allows it |
if (!dataDirectory.setReadable(false, false) || !dataDirectory.setWritable(false, false) |
|| !dataDirectory.setExecutable(false, false)) { |
LOGGER.warning("unable to change permissions for everybody: " + dataDirectory); |
} |