Skip to content

FileDataStoreFactory method setPermissionsToOwnerOnly only supports Unix #315

Closed
@rbeede

Description

@rbeede

com.google.api.client.util.store.FileDataStoreFactory

setPermissionsToOwnerOnly does not use newer Java 7 or 8 APIs for setting file/dir ownership and thus generates spurious warnings like "com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for everybody: "

The code only takes into account file systems as seen on Unix-like OSes that use a simple mode for the permissions. Windows file systems have ACLs and require different API calls to modify ownership and permissions. The latest Java APIs should be used instead which can handle both file system types.

This warning occurs for anyone using the Drive API SDK samples and causes confusion for new developers using the API.

https://github.com/google/google-http-java-client/blob/dev/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions