public ImmutablePair<Long, Long> getDeviceInfo(final Folder folder) {
        try {

            //get free space and number of files
            final ImmutablePair<Long, Long> freeSpaceAndNumberOfFiles;
            switch (folder.getBaseType()) {
                case DOCUMENT:
                    freeSpaceAndNumberOfFiles = getDeviceInfoForDocument(folder);
                    break;
                case FILE:
                default:
                    freeSpaceAndNumberOfFiles = new ImmutablePair<>(FileUtils.getFreeDiskSpace(
                            new File(ContentStorage.get().getUriForFolder(folder).getPath())), -1L);
                    break;
            }
            return freeSpaceAndNumberOfFiles;
        } catch (Exception e) {
            Log.i("Exception while getting system information for " + folder, e);
            return new ImmutablePair<>(-1L, -1L);
        }
    }
returns: left: free space on folder device (in bytes), right: number of files on device (may be -1 if not calculateable)
main/src/main/java/cgeo/geocaching/storage/FolderUtils.java