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

cn.featherfly.common.mail.MailAttach Maven / Gradle / Ivy

There is a newer version: 0.4.4
Show newest version

package cn.featherfly.common.mail;

import java.io.File;

import cn.featherfly.common.lang.AssertIllegalArgument;
import cn.featherfly.common.lang.Lang;

/**
 * 

* MailAttach *

* * @author 钟冀 */ public class MailAttach { private String fileName; private File file; /** */ public MailAttach(File file) { init(file, null); } /** */ public MailAttach(File file, String fileName) { init(file, fileName); } private void init(File file, String fileName) { AssertIllegalArgument.isNotNull(file, "String fileName"); AssertIllegalArgument.isExists(file, "File file"); this.file = file; if (Lang.isEmpty(fileName)) { this.fileName = file.getName(); } else { this.fileName = fileName; } } /** * 返回fileName * * @return fileName */ public String getFileName() { return fileName; } /** * 返回file * * @return file */ public File getFile() { return file; } /** * {@inheritDoc} */ @Override public String toString() { return file.getAbsolutePath() + " : " + fileName; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy