Forked from anderson-martins/listaDiretorio.java
Last active
August 29, 2015 14:06
-
-
Save adrianokerber/aa900b2fd23b80f88bf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static java.util.List<FileItem> listDirectoryAppend(File dir, java.util.List<FileItem> lista) { | |
if (dir.isDirectory()) { | |
String[] filhos = dir.list(); | |
for (int i = 0; i < filhos.length; i++) { | |
File nome = new File(dir, filhos[i]); | |
if (nome.isFile()) { | |
if (nome.getName().toUpperCase().endsWith(".GBK")) { | |
lista.add(new FileItem(nome)); | |
} | |
} else if (nome.isDirectory()) { | |
listDirectoryAppend(nome, lista); | |
} | |
} | |
} else { | |
lista.add(new FileItem(dir)); | |
} | |
return lista; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment