Code example for File

Methods: exists, getAbsolutePath, isFile

0
            throw new RuntimeException(e);
        } 
    } 
 
    public void validate() { 
        if (!androidManifestFile.exists() || !androidManifestFile.isFile()) {
            throw new RuntimeException(androidManifestFile.getAbsolutePath() + " not found or not a file; it should point to your project's AndroidManifest.xml");
        } 
    } 
 
    private void parseAndroidManifest() { 
        if (manifestIsParsed) {
            return; 
        } 
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        try { 
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document manifestDocument = db.parse(androidManifestFile);
 
            packageName = getTagAttributeText(manifestDocument, "manifest", "package");
            rClassName = packageName + ".R";