-
-
Save rodrigobravo/4813cae7dff5d2fa18b029e3c7d1ba73 to your computer and use it in GitHub Desktop.
Lista arquivos, pastas e subpastas de um diretorio
This file contains hidden or 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