Code example for File

Methods: isDirectory, list

0
 
    private ResourceLoader resourceLoader;
 
    @Implementation 
    public final String[] list(String path) throws IOException {
        File file = new File(resourceLoader.getAssetsBase(), path);
        if (file.isDirectory()) {
            return file.list();
        } 
        return new String[0];
    } 
 
    @Implementation 
    public final InputStream open(String fileName) throws IOException {
        return new FileInputStream(new File(resourceLoader.getAssetsBase(), fileName));
    } 
 
}