title: Can't transfer ownership of google drive txt files using gmail account and java API
body: <p>I am developing a multi user java web application which lets users list/share their google drive files between gmail accounts. I utilize oauth2 authorization code flow where user accessing my app, gets redirected to gmail for login and then grants access for &quot;google drive&quot; scopes to my app. My app then consumes the user access token to invoke google drive APIs using their java sdk.</p>
  <p>I have uploaded MS word doc and a text file on source drive, I am trying to transfer the ownership of both to my another gmail account using my app. I am able to transfer the ownership of .doc file using my code but it fails for .txt file. I tried to simulate this operation using &quot;TRY API&quot; <a href="https://developers.google.com/drive/api/v3/reference/permissions/create" rel="nofollow noreferrer">https://developers.google.com/drive/api/v3/reference/permissions/create</a> and see the same error.</p>
  <pre><code>Error:
    &quot;code&quot;: 400,
    &quot;message&quot;: &quot;Bad Request. User message: \&quot;You can't change the owner of this item.\&quot;&quot;
  </code></pre>
  <pre><code> Permission newOwnerPermission = new Permission();
   newOwnerPermission.setEmailAddress(newOwnerEmail);
   newOwnerPermission.setType(&quot;user&quot;);
   newOwnerPermission.setRole(&quot;owner&quot;); 
   driveService.permissions().create(fileId,newOwnerPermission).setTransferOwnership(true).execute();
  </code></pre>
  <p>I can make my another gmail account a &quot;writer&quot; on txt file but not an &quot;owner&quot; - using either java code or google's &quot;try api&quot;.
  Do I need to change something based on mimeType in my request? I don't see anything obvious in docs</p>