FileDocCategorySizeDatePackage
ObbScanner.javaAPI DocAndroid 5.1 API2187Thu Mar 12 22:22:10 GMT 2015android.content.res

ObbScanner

public class ObbScanner extends Object
Class to scan Opaque Binary Blob (OBB) files. Use this to get information about an OBB file for use in a program via {@link ObbInfo}.

Fields Summary
Constructors Summary
private ObbScanner()

Methods Summary
public static ObbInfogetObbInfo(java.lang.String filePath)
Scan a file for OBB information.

param
filePath path to the OBB file to be scanned.
return
ObbInfo object information corresponding to the file path
throws
IllegalArgumentException if the OBB file couldn't be found
throws
IOException if the OBB file couldn't be read

        if (filePath == null) {
            throw new IllegalArgumentException("file path cannot be null");
        }

        final File obbFile = new File(filePath);
        if (!obbFile.exists()) {
            throw new IllegalArgumentException("OBB file does not exist: " + filePath);
        }

        /*
         * XXX This will fail to find the real canonical path if bind mounts are
         * used, but we don't use any bind mounts right now.
         */
        final String canonicalFilePath = obbFile.getCanonicalPath();

        ObbInfo obbInfo = new ObbInfo();
        obbInfo.filename = canonicalFilePath;
        getObbInfo_native(canonicalFilePath, obbInfo);

        return obbInfo;
    
private static native voidgetObbInfo_native(java.lang.String filePath, ObbInfo obbInfo)