xxx.class.getResource("")获取是什么路径
答:
假如xxx在F:/jianzhi/idea_items/fish_port_admin/common-bx-auth/target/classes/com/bx/cloud/common/auth/controller/目录下
xxx.class.getResource("").getFile();//获取xxx类class文件所在目录
/F:/jianzhi/idea_items/fish_port_admin/common-bx-auth/target/classes/com/bx/cloud/common/auth/controller/
xxx.class.getResource("/").getFile();//获取class文件所在根目录
/F:/jianzhi/idea_items/fish_port_admin/common-bx-auth/target/classes/
xxx.class.getResource("SSOController.class").getFile();//获取和xxx同目录下的SSOController.class文件
/F:/jianzhi/idea_items/fish_port_admin/common-bx-auth/target/classes/SSOController.class
xxx.class.getResource("../").getFile();//获取xxx类class文件的上级目录
/F:/jianzhi/idea_items/fish_port_admin/common-bx-auth/target/classes/com/bx/cloud/common/auth