Back to project page AsciiCamera.
The source code is released under:
Apache License
If you think the Android project AsciiCamera listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
// Copyright (C) 2014 Bruno Ramalhete //from w w w .j a v a 2s .c o m package com.spectralsoftware.asciicamera; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Represents a directory where the PNG and HTML versions of saved pictures are stored. */ public class ImageDirectory { String baseDirectory; List<File> imageFiles = new ArrayList<File>(); public ImageDirectory(String basedir) { this.baseDirectory = basedir; updateImageList(); } public void updateImageList() { imageFiles.clear(); File[] basedirContents = (new File(baseDirectory)).listFiles(); for(File f : basedirContents) { if (f.isDirectory()) { File imageFile = new File(f.getAbsolutePath() + File.separator + f.getName() + ".html"); if (imageFile.isFile()) { imageFiles.add(imageFile); } } } } public int getFileCount() { return imageFiles.size(); } public File getFileForIndex(int index) { return imageFiles.get(index); } public String getFilePathForIndex(int index) { return imageFiles.get(index).getAbsolutePath(); } }