Code example for File

Methods: isFile, length

0
File file;
        if (isSystem(alias)) {
            file = new File(systemDir, alias.substring(PREFIX_SYSTEM.length()));
        } else if (isUser(alias)) {
            file = new File(addedDir, alias.substring(PREFIX_USER.length()));
        } else { 
            return null; 
        } 
        if (!file.exists() || isTombstone(file)) {
            // silently elide tombstones 
            return null; 
        } 
        return file;
    } 
 
    private boolean isTombstone(File file) {
        return file.length() == 0;
    } 
 
    private X509Certificate readCertificate(File file) {
        if (!file.isFile()) {
            return null; 
        } 
        InputStream is = null;
        try { 
            is = new BufferedInputStream(new FileInputStream(file));