📄 fileinfo.java
字号:
/**
* @(#)FileInfo.java Nov 23, 2006 4:51:40 PM
*
* COPYRIGHT DaTang Mobile Communications Equipment CO.,LTD
*/
package com.datangmobile.oss.omc.pc.util;
import java.io.File;
import java.io.Serializable;
import java.util.Date;
/**
* 要解析的文件的文件名和上传文件的网元类型
*
* @author liuyuan
*
*/
public class FileInfo implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5343416400981806493L;
/**
* 记录DB异常码
*/
public static final int DB_EXCEPTION = 1;
/**
* 记录IO异常码
*/
public static final int IO_EXCEPTION = 2;
/**
* 记录CDL文件没有临时表可用的异常码
*/
public static final int NO_TEMP_TABLE_EXCEPTION = 3;
/**
* 记录其他异常码
*/
public static final int OTHER_EXCEPTION = 4;
/**
* 要解析的文件的文件名
*/
private File file;
/**
* 上传文件的网元类型
*/
private String neType;
/**
* 上传文件的文件类型(V2、V3;CDL、一般性能数据文件)
*/
private String fileType;
/**
* 上传文件的网元dn 以支持多版本管理
*/
private String dn;
/**
* 第一次解析的时间
*/
private Date firstParseTime;
/**
* 上一次解析的时间
*/
private Date lastParseTime;
/**
* 第一次解析的错误码
*/
private int firstErrorCode;
/**
* 上一次解析的错误码
*/
private int lastErrorCode;
/**
* @return Returns the file.
*/
public File getFile() {
return file;
}
/**
* @param file
* The file to set.
*/
public void setFile(File file) {
this.file = file;
}
public String getNeType() {
return neType;
}
public void setNeType(String neType) {
this.neType = neType;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object o) {
if (null == o) {
return false;
} else if (this.getFile().getPath().equals(
((FileInfo) o).getFile().getPath())) {
return true;
}
return false;
}
/**
* @return the dn
*/
public String getDn() {
return dn;
}
/**
* @param dn
* the dn to set
*/
public void setDn(String dn) {
this.dn = dn;
}
@Override
public String toString() {
return this.getFile().getPath() + ", " + this.getFileType();
}
public int getFirstErrorCode() {
return firstErrorCode;
}
public void setFirstErrorCode(int firstErrorCode) {
this.firstErrorCode = firstErrorCode;
}
public Date getFirstParseTime() {
return firstParseTime;
}
public void setFirstParseTime(Date firstParseTime) {
this.firstParseTime = firstParseTime;
}
public int getLastErrorCode() {
return lastErrorCode;
}
public void setLastErrorCode(int lastErrorCode) {
this.lastErrorCode = lastErrorCode;
}
public Date getLastParseTime() {
return lastParseTime;
}
public void setLastParseTime(Date lastParseTime) {
this.lastParseTime = lastParseTime;
}
/**
* 设置异常信息(当解析出错时)
*/
public void setExceptionInfo(Date time, int errorCode) {
if (firstParseTime == null) {// 这次就是第一次
firstParseTime = time;
firstErrorCode = errorCode;
lastParseTime = time;
lastErrorCode = errorCode;
} else {// 不是第一次了
lastParseTime = time;
lastErrorCode = errorCode;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -