MyFile.java
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.common;
- import java.io.*;
- public class MyFile {
- private File file;
- public MyFile() {
- }
- private static String getNameWithoutExtension(String fileName) {
- return fileName.substring(0, fileName.lastIndexOf("."));
- }
- private String getExtension(String fileName) {
- return fileName.substring(fileName.lastIndexOf(".") + 1);
- }
- public String getExtName() {
- return this.getExtension(this.file.getName());
- }
- public File getFile() {
- return file;
- }
- public String getFileName() {
- return this.file.getName();
- }
- public String getNoExtName() {
- return this.getNameWithoutExtension(this.file.getName());
- }
- public void setFile(File file) {
- this.file = file;
- }
- }