public class FileUtil extends Object
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAbsolutePath(File file)
获取文件绝对路径
|
static String |
getAbsolutePath(String absolutePath)
获取文件全路径
|
static String |
getFileName(String pathName)
传入文件的绝对路径+拓展名,返回文件名+拓展名
|
public static String getFileName(String pathName)
pathName - windows
eg. 1 在文件系统中的绝对路径
D:\dev_ideaProjects\smart-ivr\smart-ivr-payment\src\main\resources\public\scene1\force-硅基客户-360.wav
eg.2 在项目中的相对路径
src\main\resources\public\scene1\force-硅基客户-360.wav
linux eg. 1 在文件系统中的绝对路径 /usr/root/wrokspace/smart-ivr/smart-ivr-payment/src/main/resources/public/scene1/force-硅基客户-360.wav eg.2 在项目中的相对路径 src/main/resources/public/scene1/force-硅基客户-360.wav
Copyright © 2021. All rights reserved.