Package com.android.io

Examples of com.android.io.FileWrapper


    }

    @Override
    public Object getMinSdkVersion(@NonNull File manifestFile) {
        try {
            return AndroidManifest.getMinSdkVersion(new FileWrapper(manifestFile));
        } catch (XPathExpressionException e) {
            // won't happen.
        } catch (StreamException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


    }

    @Override
    public Object getTargetSdkVersion(@NonNull File manifestFile) {
        try {
            return AndroidManifest.getTargetSdkVersion(new FileWrapper(manifestFile));
        } catch (XPathExpressionException e) {
            // won't happen.
        } catch (StreamException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    @Override
    public int getMinSdkVersion(@NonNull File manifestFile) {
        try {
            Object value = AndroidManifest.getMinSdkVersion(new FileWrapper(manifestFile));
            if (value instanceof Integer) {
                return (Integer) value;
            } else if (value instanceof String) {
                // TODO: support codename
            }
View Full Code Here

    }

    @Override
    public int getTargetSdkVersion(@NonNull File manifestFile) {
        try {
            Integer value = AndroidManifest.getTargetSdkVersion(new FileWrapper(manifestFile));
            if (value != null) {
                return value;
            } else {
                return -1;
            }
View Full Code Here

    }

    @Override
    public int getMinSdkVersion(@NonNull File manifestFile) {
        try {
            Object value = AndroidManifest.getMinSdkVersion(new FileWrapper(manifestFile));
            if (value instanceof Integer) {
                return ((Integer)value).intValue();
            } else if (value instanceof String) {
                // TODO: support codename
            }
View Full Code Here

    }

    @Override
    public int getMinSdkVersion(@NonNull File manifestFile) {
        try {
            Object value = AndroidManifest.getMinSdkVersion(new FileWrapper(manifestFile));
            if (value instanceof Integer) {
                return ((Integer)value).intValue();
            } else if (value instanceof String) {
                // TODO: support codename
            }
View Full Code Here

            @NonNull File addonDir, @NonNull IAndroidTarget[] targetList,
            @NonNull ILogger log) {
        Map<String, String> propertyMap = null;
        String error = null;

        FileWrapper addOnManifest = new FileWrapper(addonDir,
                SdkConstants.FN_MANIFEST_INI);

        do {
            if (!addOnManifest.isFile()) {
                error = String.format("File not found: %1$s",
                        SdkConstants.FN_MANIFEST_INI);
                break;
            }
View Full Code Here

            // In the case of a platform with override values from the user, the skin value might
            // already be there, but it's ok.

            HashMap<String, String> finalHardwareValues = new HashMap<String, String>();

            FileWrapper targetHardwareFile = new FileWrapper(target.getLocation(),
                    AvdManager.HARDWARE_INI);
            if (targetHardwareFile.isFile()) {
                Map<String, String> targetHardwareConfig = ProjectProperties.parsePropertyFile(
                        targetHardwareFile, log);

                if (targetHardwareConfig != null) {
                    finalHardwareValues.putAll(targetHardwareConfig);
                    values.putAll(targetHardwareConfig);
                }
            }

            // get the hardware properties for this skin
            if (skinFolder != null) {
                FileWrapper skinHardwareFile = new FileWrapper(skinFolder, AvdManager.HARDWARE_INI);
                if (skinHardwareFile.isFile()) {
                    Map<String, String> skinHardwareConfig =
                        ProjectProperties.parsePropertyFile(skinHardwareFile, log);

                    if (skinHardwareConfig != null) {
                        finalHardwareValues.putAll(skinHardwareConfig);
View Full Code Here

     * @return A new {@link AvdInfo} with an {@link AvdStatus} indicating whether this AVD is
     *         valid or not.
     */
    private AvdInfo parseAvdInfo(File iniPath, ILogger log) {
        Map<String, String> map = parseIniFile(
                new FileWrapper(iniPath),
                log);

        String avdPath = map.get(AVD_INFO_ABS_PATH);
        String targetHash = map.get(AVD_INFO_TARGET);

        if (!(new File(avdPath).isDirectory())) {
            // Try to fallback on the relative path, if present.
            String relPath = map.get(AVD_INFO_REL_PATH);
            if (relPath != null) {
                try {
                    String androidPath = AndroidLocation.getFolder();
                    File f = new File(androidPath, relPath);
                    if (f.isDirectory()) {
                        avdPath = f.getAbsolutePath();
                    }
                } catch (AndroidLocationException ignore) {}
            }
        }

        IAndroidTarget target = null;
        FileWrapper configIniFile = null;
        Map<String, String> properties = null;

        if (targetHash != null) {
            target = myLocalSdk.getTargetFromHashString(targetHash);
        }

        // load the AVD properties.
        if (avdPath != null) {
            configIniFile = new FileWrapper(avdPath, CONFIG_INI);
        }

        if (configIniFile != null) {
            if (!configIniFile.isFile()) {
                log.warning("Missing file '%1$s'.",  configIniFile.getPath());
            } else {
                properties = parseIniFile(configIniFile, log);
            }
        }

View Full Code Here

    }

    @Override
    public int getMinSdkVersion(@NonNull File manifestFile) {
        try {
            Object value = AndroidManifest.getMinSdkVersion(new FileWrapper(manifestFile));
            if (value instanceof Integer) {
                return (Integer) value;
            } else if (value instanceof String) {
                // TODO: support codename
            }
View Full Code Here

TOP

Related Classes of com.android.io.FileWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.