📄 cdcardfile.java
字号:
package jp.co.sjts.gsession.card;
import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.util.Properties;
import java.util.StringTokenizer;
import jp.co.sjts.gsession.tools.*;
/**
* 柤巋僨乕僞僆僽僕僃僋僩偱偡丅<BR>
*
* @author Ei KISHIDA <ei@sjts.co.jp>
* @author Hideyuki KITADE <kitade@sjts.co.jp>
*/
public class CDCardFile extends GSTextFile{
/** 儐乕僓ID */
public static final String V1 = "entuserid";
/** 扴摉儐乕僓ID */
public static final String V2 = "alocuserid";
/** 扴摉幰GROUPID */
public static final String V3 = "alocgroup";
/** 嬈庬柤 */
public static final String V5 = "employname";
/** 夛幮柤 */
public static final String V6 = "coname";
/** 夛幮柤偐側 */
public static final String V7 = "cokname";
/** 強懏 */
public static final String V8 = "belong";
/** 栶怑 */
public static final String V9 = "position";
/** 柤慜 */
public static final String V10 = "name";
/** 柤慜偐側 */
public static final String V11 = "kname";
/** 梄曋斣崋 */
public static final String V12 = "postno";
/** 廧強侾*/
public static final String V13 = "address1";
/** 廧強俀 */
public static final String V14 = "address2";
/** 夛幮揹榖 */
public static final String V15 = "cotel";
/** 夛幮FAX */
public static final String V16 = "cofax";
/** 帺戭揹榖 */
public static final String V17 = "pbtel";
/** 実懷揹榖 */
public static final String V18 = "ptel";
/** E-MAIL */
public static final String V19 = "mail";
/** URL */
public static final String V20 = "url";
/** 岞奐 */
public static final String V21 = "secret";
/** 懠儐乕僓曇廤 */
public static final String V22 = "edit";
/** 旛峫 */
public static final String V23 = "memo";
/** temp */
public final static String TEMP = "tmp";
/** */
private Properties properties=null;
/** 柤帉僨乕僞僼傽僀儖 */
private File file;
/** 僼傽僀儖僷僗 */
private String filePath = null;
/** 搊榐儐乕僓ID */
private int entuserid=-1;
/** 扴摉儐乕僓ID */
private int alocuserid=-1;
/** 扴摉幰GROUPID */
private int alocgroup=-1;
/** 嬈庬柤 */
private String employname="";
/** 夛幮柤 */
private String coname="";
/** 夛幮柤偐側 */
private String cokname="";
/** 強懏 */
private String belong="";
/** 栶怑 */
private String position="";
/** 柤慜 */
private String name="";
/** 柤慜偐側 */
private String kname="";
/** 梄曋斣崋 */
private String postno="";
/** 廧強侾 */
private String address1="";
/** 廧強俀 */
private String address2="";
/** 夛幮揹榖 */
private String cotel="";
/** 夛幮FAX */
private String cofax="";
/** 帺戭揹榖 */
private String pbtel="";
/** 実懷揹榖 */
private String ptel="";
/** E-MAIL */
private String mail="";
/** URL */
private String url="";
/** 岞奐 */
private String secret="";
/** 懠儐乕僓曇廤 */
private String edit="";
/** 旛峫 */
private String memo="";
/**
* <p>弶婜壔傪峴偄傑偡丅
*
* @param HomeDir 僨乕僞僨傿儗僋僩儕
* @param Id
* @param mode
*/
public CDCardFile(String HomeDir,String Id,int mode) throws GSException{
properties = System.getProperties();
String GrpDir = HomeDir;
GrpDir = GrpDir.replace('/',this.properties.getProperty("file.separator").charAt(0));
// 僨傿儗僋僩儕偺桳岠惈傪僠僃僢僋
try{
File file1 = new File(GrpDir);
if(!file1.exists()) // 僼傽僀儖偑懚嵼偡傞偐
{
if(!file1.mkdirs()) // 僼傽僀儖偑懚嵼偟側偄応崌偼丄嶌惉傪帋傒傞
throw new GSException("僨傿儗僋僩儕嶌惉偵帋傒偨偑幐攕偟傑偟偨丅");
}
} catch (SecurityException e) {
throw new GSException("傾僋僙僗尃僄儔乕:"+GrpDir);
}
if(mode==0)
{
filePath = GrpDir + file.separator + Id;
}else{
filePath = GrpDir + file.separator + Id + file.separator + TEMP;
}
this.file = new File(filePath);
}
/**
* <p>僷儔儊乕僞僙僢僩
*
* @param entuserid 搊榐幰儐乕僓ID
* @param alocuserid 扴摉儐乕僓ID
* @param alocgroup 扴摉幰僌儖乕僾ID
* @param employname 嬈庬
* @param coname 夛幮柤
* @param cokname 夛幮柤偐側
* @param belong 強懏
* @param position 栶怑
* @param name 柤慜
* @param kname 柤慜偐側
* @param postno 梄曋斣崋
* @param address1 廧強1
* @param address2 廧強2
* @param cotel 夛幮揹榖斣崋
* @param cofax 夛幮FAX
* @param pbtel 帺戭揹榖斣崋
* @param ptel 実懷揹榖
* @param mail 儊乕儖傾僪儗僗
* @param url URL
* @param secret 岞奐僼儔僌 0:岞奐偡傞丅,1:岞奐偟側偄
* @param edit 曇廤僼儔僌 0:墘廗傪嫋壜,1:曇廤傪嫋壜偟側偄
* @param memo 旛峫
*/
public void CDCard(int entuserid,int alocuserid,int alocgroup,String employname,String coname,
String cokname, String belong, String position, String name, String kname,
String postno, String address1, String address2, String cotel, String cofax,
String pbtel, String ptel, String mail, String url, String secret, String edit,
String memo){
this.entuserid = entuserid;
this.alocuserid = alocuserid;
this.alocgroup = alocgroup;
this.employname = chkStrEnc(employname);
this.coname = chkStrEnc(coname);
this.cokname = chkStrEnc(cokname);
this.belong = chkStrEnc(belong);
this.position = chkStrEnc(position);
this.name = chkStrEnc(name);
this.kname = chkStrEnc(kname);
this.postno = chkStrEnc(postno);
this.address1 = chkStrEnc(address1);
this.address2 = chkStrEnc(address2);
this.cotel = chkStrEnc(cotel);
this.cofax = chkStrEnc(cofax);
this.pbtel = chkStrEnc(pbtel);
this.ptel = chkStrEnc(ptel);
this.mail = chkStrEnc(mail);
this.url = chkStrEnc(url);
this.secret = chkStrEnc(secret);
this.edit = chkStrEnc(edit);
this.memo = memo;
}
/**
* <p>搊榐幰偺儐乕僓ID傪僙僢僩偟傑偡丅
*
* @pram entuserid 搊榐幰偺儐乕僓ID
*/
public void setEntuserid(int entuserid) {
this.entuserid = entuserid;
}
/**
* <p>扴摉幰偺儐乕僓ID傪僙僢僩偟傑偡丅
*
* @param alocuserid 扴摉幰偺儐乕僓ID
*/
public void setAlocuserid(int alocuserid) {
this.alocuserid = alocuserid;
}
/**
* <p>扴摉幰偺僌儖乕僾ID傪僙僢僩偟傑偡丅
*
* @param alocgroup 扴摉幰僌儖乕僾ID
*/
public void setAlocgroup(int alocgroup) {
this.alocgroup = alocgroup;
}
/**
* <p>嬈庬柤傪僙僢僩偟傑偡丅
*
* @param employname 嬈庬柤
*/
public void setEmployname(String employname) {
this.employname = chkStrEnc(employname);
}
/**
* <p>夛幮柤傪僙僢僩偟傑偡丅
*
* @param coname 夛幮柤
*/
public void setConame(String coname) {
this.coname = chkStrEnc(coname);
}
/**
* <p>夛幮柤偐側傪僙僢僩偟傑偡丅
*
* @param cokname 夛幮柤偐側
*/
public void setCokname(String cokname) {
this.cokname = chkStrEnc(cokname);
}
/**
* <p>強懏傪僙僢僩偟傑偡丅
*
* @param belong 強懏
*/
public void setBelong(String belong) {
this.belong = chkStrEnc(belong);
}
/**
* <p>栶怑傪僙僢僩偟傑偡丅
*
* @param position 栶怑
*/
public void setPosition(String position) {
this.position = chkStrEnc(position);
}
/**
* <p>柤慜傪僙僢僩偟傑偡丅
*
* @param name 柤慜
*/
public void setName(String name) {
this.name = chkStrEnc(name);
}
/**
* <p>柤慜偐側傪僙僢僩偟傑偡丅
*
* @param kname 柤慜偐側
*/
public void setKname(String kname) {
this.kname = chkStrEnc(kname);
}
/**
* <p>梄曋斣崋傪僙僢僩偟傑偡丅
*
* @param postno 梄曋斣崋
*/
public void setPostno(String postno) {
this.postno = chkStrEnc(postno);
}
/**
* <p>廧強侾傪僙僢僩偟傑偡丅
*
* @param address1 廧強侾
*/
public void setAddress1(String address1) {
this.address1 = chkStrEnc(address1);
}
/**
* <p>廧強俀傪僙僢僩偟傑偡丅
*
* @param address2 廧強俀
*/
public void setAddress2(String address2) {
this.address2 = chkStrEnc(address2);
}
/**
* <p>夛幮揹榖斣崋傪僙僢僩偟傑偡丅
*
* @param cotel 夛幮揹榖斣崋
*/
public void setCotel(String cotel) {
this.cotel = chkStrEnc(cotel);
}
/**
* <p>夛幮FAX傪僙僢僩偟傑偡丅
*
* @param cofax 夛幮FAX斣崋
*/
public void setCofax(String cofax) {
this.cofax = chkStrEnc(cofax);
}
/**
* <p>帺戭揹榖斣崋傪僙僢僩偟傑偡丅
*
* @param pbtel 帺戭揹榖斣崋
*/
public void setPbtel(String pbtel) {
this.pbtel = chkStrEnc(pbtel);
}
/**
* <p>実懷揹榖斣崋傪僙僢僩偟傑偡丅
*
* @param ptel 実懷揹榖斣崋
*/
public void setPtel(String ptel) {
this.ptel = chkStrEnc(ptel);
}
/**
* <p>儊乕儖傾僪儗僗傪僙僢僩偟傑偡丅
*
* @param mail 儊乕儖傾僪儗僗
*/
public void setMail(String mail) {
this.mail = chkStrEnc(mail);
}
/**
* <p>URL傪僙僢僩偟傑偡丅
*
* @param url URL
*/
public void setUrl(String url) {
this.url = chkStrEnc(url);
}
/**
* <p>岞奐僼儔僌傪僙僢僩偟傑偡丅
*
* @param secret 岞奐僼儔僌 0:岞奐偡傞丅,1:岞奐偟側偄
*/
public void setSecret(String secret) {
this.secret = chkStrEnc(secret);
}
/**
* <p>曇廤僼儔僌傪僙僢僩偟傑偡丅
*
* @param edit 曇廤僼儔僌 0:墘廗傪嫋壜,1:曇廤傪嫋壜偟側偄
*/
public void setEdit(String edit) {
this.edit = chkStrEnc(edit);
}
/**
* <p>旛峫傪僙僢僩偟傑偡丅
*
* @param memo 旛峫
*/
public void setMemo(String memo) {
this.memo = memo;
}
/**
* <p>搊榐幰儐乕僓ID傪曉偟傑偡丅
*
* @return 搊榐幰儐乕僓ID
*/
public int getEntuserid() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -