@Override public Space get() throws BackgroundException { try { final SpaceUsage usage = new DbxUserUsersRequests(session.getClient()).getSpaceUsage(); final SpaceAllocation allocation = usage.getAllocation(); if(allocation.isIndividual()) { return new Space(usage.getUsed(), allocation.getIndividualValue().getAllocated()); } else if(allocation.isTeam()) { return new Space(usage.getUsed(), allocation.getTeamValue().getAllocated()); } return new Space(0L, Long.MAX_VALUE); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Failure to read attributes of {0}", e, new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory))); } } }