Created
August 9, 2015 05:18
-
-
Save razerdp/44855d6b1d6327dfadbc 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 List<String> getFilesFromFolder(String folderPath, String prefixion, String type);//获取指定文件夹指定后缀和自定义前缀的方法,支持"*"后缀 | |
public String getFileNameNoEx(String filename);//获取指定文件的文件名 | |
public String getExtensionName(String filename);//获取指定文件的后缀名 | |
这里主要说明第一个方法,第一个方法有三个参数 | |
-folderPath:文件夹路径,方法会判断是否为文件夹,如果不是,则返回null,所以使用方法请判断返回值是否为空 | |
-prefixion:这个我应该打错英文了,晚会修改,这个用于添加前缀,主要方便为文件路径添加如file://这种uri,可以为空 | |
-type:文件的后缀,可以写".txt"或者"txt",也就是说文件后缀您加点或者不加点都一样,也可以传入"*",这样就会找寻指定文件夹内所有的文件(不会找出文件夹哦) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment