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获取路径和文件名
最新推荐文章于 2024-02-23 19:57:27 发布