I want to write some metadata from Drive files in a spreadsheet. I get the owner, name, Id, url, etc., but I'm having problems with the File#getEditors()
and File#getViewers()
methods.
I get this value written in the cells where the editors and viewers results are written:
[Ljava.lang.Object@....
Anyone knows what is happening? I'm the owner of the files.
My script:
function getChildFolders(parentName, parent, data, sheet, listAll) {
sheet.appendRow(["Full Path", "Name", "Type", "URL", "Access", "Permission", "Editors can share", "Owner", "Can edit", "Can comment", "Can view"]);
var childFolders = parent.getFolders();
var childFiles = parent.getFiles();
while (childFiles.hasNext()) {
var fileItem = childFiles.next();
data = [
parentName + "/" + fileItem.getName() + "/" + fileItem.getName(),
fileItem.getName(),
fileItem.getMimeType(),
fileItem.getUrl(),
fileItem.getAccess(Session.getActiveUser()),
fileItem.getSharingPermission(),
fileItem.isShareableByEditors(),
fileItem.getOwner().getEmail(),
fileItem.getEditors(),
fileItem.getViewers()
];
// Write
sheet.appendRow(data);
}