Resolve absolute paths with wildcards in Java 6

时光毁灭记忆、已成空白 提交于 2019-12-13 15:40:09

问题


My problem is that I have a number of directories I have to look into programmatically, in Java. These directories all have the same pattern:

d:\a\b\c\??_????\d\

I cannot find a way to do this smartly. Any FileFilter (I use WildcardFileFilter) will need a base directory to look into, as they only works with listFiles(), yet in my case there is not base directory as my paths are absolute. I've unsuccessfully tried a few tricks from the Web and then I'm stuck. Your help will be greatly appreciated.enter link description here


回答1:


Try use listFilesAndDirs pointing to root folder or to d:\a\b\c.



来源:https://stackoverflow.com/questions/25682140/resolve-absolute-paths-with-wildcards-in-java-6

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