read files names from directory without System files(.DS_Store)

↘锁芯ラ 提交于 2019-12-25 04:26:42

问题



Im trying to read all filenames from a folder and save them in an array but im still reading all files (including the system folder .DS_Storefrom)so that my code doesn´t work for what i want to do. anyone knows how to read only non Systems files/folder? Thanks for the help!

Here´s what i wrote,

String pathLevel= "/Users/lan/Desktop/top/";


        File file = new File(pathLevel);
        String [] levelNames = file.list();
        String [] matrix= new String[levelNames.length];

来源:https://stackoverflow.com/questions/28290744/read-files-names-from-directory-without-system-files-ds-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!