表单提交
This commit is contained in:
@@ -11,9 +11,25 @@ import java.io.Serializable;
|
||||
@AllArgsConstructor
|
||||
public class FileVO implements Serializable {
|
||||
|
||||
|
||||
//全名 路径+文件名
|
||||
private String name;
|
||||
//文件名
|
||||
private String fileName;
|
||||
|
||||
private String url;
|
||||
public FileVO( String name,String url){
|
||||
this.name = name;
|
||||
this.fileName = getFileName(name);
|
||||
this.url = url;
|
||||
|
||||
}
|
||||
public static String getFileName(String filePath) {
|
||||
int index = filePath.lastIndexOf("/");
|
||||
if (index == -1) {
|
||||
return filePath; // 如果没有/,则返回整个路径
|
||||
} else {
|
||||
return filePath.substring(index + 1); // 截取最后一个/后面的部分作为文件名
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user