@@ -0,0 +1,1579 @@
+package com.novoda.downloadmanager;%0A%0Aimport android.os.StatFs;%0A%0Aimport java.io.File;%0A%0Apublic final class ByteBasedStorageRequirementRule implements StorageRequirementRule %7B%0A%0A    private final StorageCapacityReader storageCapacityReader;%0A    private final long bytesRemainingAfterDownload;%0A%0A    public static ByteBasedStorageRequirementRule withPercentageOfStorageRemaining(long bytesRemainingAfterDownload) %7B%0A        return new ByteBasedStorageRequirementRule(new StorageCapacityReader(), bytesRemainingAfterDownload);%0A    %7D%0A%0A    private ByteBasedStorageRequirementRule(StorageCapacityReader storageCapacityReader, long bytesRemainingAfterDownload) %7B%0A        this.storageCapacityReader = storageCapacityReader;%0A        this.bytesRemainingAfterDownload = bytesRemainingAfterDownload;%0A    %7D%0A%0A    @Override%0A    public boolean hasViolatedRule(File storageDirectory,%0A                                   FileSize downloadFileSize) %7B%0A        StatFs statFs = new StatFs(storageDirectory.getPath());%0A        long storageCapacityInBytes = storageCapacityReader.storageCapacityInBytes(statFs);%0A        long usableStorageInBytes = storageDirectory.getUsableSpace();%0A        long remainingStorageAfterDownloadInBytes = usableStorageInBytes - downloadFileSize.totalSize();%0A%0A        Logger.v(%22Storage capacity in bytes: %22, storageCapacityInBytes);%0A        Logger.v(%22Usable storage in bytes: %22, usableStorageInBytes);%0A        Logger.v(%22Minimum required storage in bytes: %22, bytesRemainingAfterDownload);%0A        return remainingStorageAfterDownloadInBytes %3C bytesRemainingAfterDownload;%0A    %7D%0A%0A%7D%0A

Create a byte based storage requirement rule.