Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.io.FilenameFilter;

import android.os.Environment;

public class Main {
    private static final FilenameFilter narFilter = new FilenameFilter() {
        public boolean accept(File dir, String filename) {
            if (filename.endsWith(".nar") || filename.endsWith(".zip"))
                return true;

            return false;
        }
    };

    public static String[] listNarDir() {
        File narDir = new File(Environment.getExternalStorageDirectory(), "nar");
        if (narDir.exists() == false || narDir.isDirectory() == false)
            return null;

        String[] ret = narDir.list(narFilter);
        return ret;
    }
}