62,615
社区成员
发帖
与我相关
我的任务
分享
public class Qustion {
jarLooger = ....;
public static void main(String[] args) throws IOException {
Files.walkFileTree(Paths.get("c:\\dir1"),
new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
// TODO
try {
thirdPartyMethod();
} catch (Exception e) {
// we don`t want to catch but throw,cause we need the caller to log it.
e.printStackTrace();
jarLooger.info();
}
return super.visitFile(file, attrs);
}
});
}
public static void thirdPartyMethod () throws Exception{
throw new Exception("third party exception");
}
}