public static void main(String[] args) {
String errInfoPath="/app/home/S_I_000000000001.zip";
String errorZipFileName = errInfoPath.substring(errInfoPath.lastIndexOf("/") + 1);
String errorZipFilePath = errInfoPath.substring(0, errInfoPath.lastIndexOf("/") + 1);
System.out.println("处理后的文件名:"+errorZipFileName);
System.out.println("处理后的文件目录:"+errorZipFilePath);
}
java获取路径和文件名(亲测)
最新推荐文章于 2023-06-28 15:43:57 发布