<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java API - What is the best way to get a user's remaining free space using DbxClientV2? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279407#M16760</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;To get the user's space usage via the API v2 Java SDK, you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/DbxUserUsersRequests.html#getSpaceUsage--" target="_self"&gt;DbxUserUsersRequests.getSpaceUsage&lt;/A&gt;. That will return a &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceUsage.html" target="_self"&gt;SpaceUsage&lt;/A&gt;&amp;nbsp;object, which contains information about their 'allocation' (their total quota) and their 'used' (the amount of space they're currently using. To get the "free" amount, subtract the 'used' from the 'allocation'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that their 'allocation' will be a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceAllocation.html" target="_blank"&gt;SpaceAllocation&lt;/A&gt; object with more detail information so you can distinguish between shared team quota (if they're on a team, since team accounts share their quota) or individual quota.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're having trouble writing code to get the specific value you want, please share the code you have so far and let us know what you're stuck on.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not clear what their total allocation of their dropbox is then, so this answer only help me partially.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does their whole personal dropbox size = .getSpaceUsage.getAllocation.getIndividualValue.getAllocated ?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 17:32:55 GMT</pubDate>
    <dc:creator>nickthehero</dc:creator>
    <dc:date>2018-06-07T17:32:55Z</dc:date>
    <item>
      <title>Java API - What is the best way to get a user's remaining free space using DbxClientV2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279286#M16742</link>
      <description>&lt;P&gt;subject is self-explanatory. I can't seem to find any good info on the matter. I'm not sure exactly how storage values work in V2, as the docs are a bit... ambiguous. Or else i just cant find the right info. Best way to get this info? Thanks in advance &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@13532C4C3505179FBF012F1C117AE2EB/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:12:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279286#M16742</guid>
      <dc:creator>nickthehero</dc:creator>
      <dc:date>2019-05-29T09:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Java API - What is the best way to get a user's remaining free space using DbxClientV2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279382#M16754</link>
      <description>&lt;P&gt;To get the user's space usage via the API v2 Java SDK, you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/DbxUserUsersRequests.html#getSpaceUsage--" target="_self"&gt;DbxUserUsersRequests.getSpaceUsage&lt;/A&gt;. That will return a &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceUsage.html" target="_self"&gt;SpaceUsage&lt;/A&gt;&amp;nbsp;object, which contains information about their 'allocation' (their total quota) and their 'used' (the amount of space they're currently using. To get the "free" amount, subtract the 'used' from the 'allocation'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that their 'allocation' will be a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceAllocation.html" target="_blank"&gt;SpaceAllocation&lt;/A&gt; object with more detail information so you can distinguish between shared team quota (if they're on a team, since team accounts share their quota) or individual quota.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're having trouble writing code to get the specific value you want, please share the code you have so far and let us know what you're stuck on.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:29:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279382#M16754</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-06-07T15:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Java API - What is the best way to get a user's remaining free space using DbxClientV2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279407#M16760</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;To get the user's space usage via the API v2 Java SDK, you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/DbxUserUsersRequests.html#getSpaceUsage--" target="_self"&gt;DbxUserUsersRequests.getSpaceUsage&lt;/A&gt;. That will return a &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceUsage.html" target="_self"&gt;SpaceUsage&lt;/A&gt;&amp;nbsp;object, which contains information about their 'allocation' (their total quota) and their 'used' (the amount of space they're currently using. To get the "free" amount, subtract the 'used' from the 'allocation'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that their 'allocation' will be a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/SpaceAllocation.html" target="_blank"&gt;SpaceAllocation&lt;/A&gt; object with more detail information so you can distinguish between shared team quota (if they're on a team, since team accounts share their quota) or individual quota.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're having trouble writing code to get the specific value you want, please share the code you have so far and let us know what you're stuck on.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not clear what their total allocation of their dropbox is then, so this answer only help me partially.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does their whole personal dropbox size = .getSpaceUsage.getAllocation.getIndividualValue.getAllocated ?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 17:32:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279407#M16760</guid>
      <dc:creator>nickthehero</dc:creator>
      <dc:date>2018-06-07T17:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Java API - What is the best way to get a user's remaining free space using DbxClientV2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279422#M16761</link>
      <description>&lt;P&gt;Yes, that would make sense for a personal, not Business, account. Here's a basic example that checks the type to handle either:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SpaceUsage spaceUsage = client.users().getSpaceUsage();

long allocated;
if (spaceUsage.getAllocation().isTeam()) {
    System.out.println("Team allocation:");
    allocated = spaceUsage.getAllocation().getTeamValue().getAllocated();
} else {
    System.out.println("Individual allocation:");
    allocated = spaceUsage.getAllocation().getIndividualValue().getAllocated();
}

System.out.println("Total: " + allocated);
long used = spaceUsage.getUsed();
System.out.println("Used: " + used);
System.out.println("Free: " + (allocated - used));
&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 19:02:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-API-What-is-the-best-way-to-get-a-user-s-remaining-free/m-p/279422#M16761</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-06-07T19:02:06Z</dc:date>
    </item>
  </channel>
</rss>

