All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zoi7.file.uploader.base.BaseDocument Maven / Gradle / Ivy

package com.zoi7.file.uploader.base;

import java.io.Serializable;
import java.util.UUID;

/**
 * desc
 *
 * @author yjy
 * 2018-06-28 21:53
 */
public class BaseDocument extends BaseClass implements Serializable, Cloneable {

    private static final long serialVersionUID = 1L;

    protected String filename; // 文件名
    protected String fileType; // 文件类型

    /**
     * 生成一个唯一名称
     * @return uuid名称
     */
    protected static String generateUUIDName(String originName) {
        String uuid = UUID.randomUUID().toString();
        if (originName != null && originName.contains(".")) {
            uuid += originName.substring(originName.lastIndexOf("."), originName.length());
        }
        return uuid;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    @Override
    public String toString() {
        return "BaseDocument{" +
                "filename='" + filename + '\'' +
                ", fileType='" + fileType + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy