📄 cdcardfile.java
字号:
return entuserid;
}
/**
* <p>扴摉幰儐乕僓ID傪曉偟傑偡丅
*
* @return 扴摉幰儐乕僓ID
*/
public int getAlocuserid() {
return alocuserid;
}
/**
* <p>扴摉幰僌儖乕僾ID傪曉偟傑偡丅
*
* @return 扴摉幰僌儖乕僾ID
*/
public int getAlocgroup() {
return alocgroup;
}
/**
* <p>嬈庬柤傪曉偟傑偡丅
*
* @return 嬈庬柤
*/
public String getEmployname() {
return chkStrDec(employname);
}
/**
* <p>夛幮柤傪曉偟傑偡丅
*
* @return 夛幮柤
*/
public String getConame() {
return chkStrDec(coname);
}
/**
* <p>夛幮柤偐側傪曉偟傑偡丅
*
* @return 夛幮柤偐側
*/
public String getCokname() {
return chkStrDec(cokname);
}
/**
* <p>強懏傪曉偟傑偡丅
*
* @return 強懏
*/
public String getBelong() {
return chkStrDec(belong);
}
/**
* <p>栶怑傪曉偟傑偡丅
*
* @return 栶怑
*/
public String getPosition() {
return chkStrDec(position);
}
/**
* <p>柤慜傪曉偟傑偡丅
*
* @return 柤慜
*/
public String getName() {
return chkStrDec(name);
}
/**
* <p>柤慜偐側傪曉偟傑偡丅
*
* @return 柤慜偐側
*/
public String getKname() {
return chkStrDec(kname);
}
/**
* <p>梄曋斣崋傪曉偟傑偡丅
*
* @return 梄曋斣崋
*/
public String getPostno() {
return chkStrDec(postno);
}
/**
* <p>廧強侾傪曉偟傑偡丅
*
* @return 廧強侾
*/
public String getAddress1() {
return chkStrDec(address1);
}
/**
* <p>廧強俀傪曉偟傑偡丅
*
* @return 廧強俀
*/
public String getAddress2() {
return chkStrDec(address2);
}
/**
* <p>夛幮揹榖斣崋傪曉偟傑偡丅
*
* @return 夛幮揹榖斣崋
*/
public String getCotel() {
return chkStrDec(cotel);
}
/**
* <p>夛幮FAX斣崋傪曉偟傑偡丅
*
* @return 夛幮FAX斣崋
*/
public String getCofax() {
return chkStrDec(cofax);
}
/**
* <p>帺戭揹榖斣崋傪曉偟傑偡丅
*
* @return 帺戭揹榖斣崋
*/
public String getPbtel() {
return chkStrDec(pbtel);
}
/**
* <p>実懷揹榖斣崋傪曉偟傑偡丅
*
* @return 実懷揹榖斣崋
*/
public String getPtel() {
return chkStrDec(ptel);
}
/**
* <p>儊乕儖傾僪儗僗傪曉偟傑偡丅
*
* @return 儊乕儖傾僪儗僗
*/
public String getMail() {
return chkStrDec(mail);
}
/**
* <p>URL傪曉偟傑偡丅
*
* @return URL
*/
public String getUrl() {
return chkStrDec(url);
}
/**
* <p>岞奐僼儔僌傪曉偟傑偡丅
*
* @return 岞奐僼儔僌 0:岞奐偡傞丅,1:岞奐偟側偄
*/
public String getSecret() {
return chkStrDec(secret);
}
/**
* <p>曇廤僼儔僌傪曉偟傑偡丅
*
* @return 曇廤僼儔僌 0:墘廗傪嫋壜,1:曇廤傪嫋壜偟側偄
*/
public String getEdit() {
return chkStrDec(edit);
}
/**
* <p>旛峫傪曉偟傑偡丅
*
* @return 旛峫
*/
public String getMemo() {
return memo;
}
/**
* <p>僼傽僀儖僆僽僕僃僋僩傪曉偟傑偡丅
*
* @return 僼傽僀儖僆僽僕僃僋僩
*/
public synchronized File GetFile(){
return file;
}
/**
* <p>僨乕僞傪撉傒崬傒傑偡丅
* <p>偙偺Read儊僜僢僪傪捈愙巊梡偡傞偙偲偼偁傝傑偣傫丅Load儊僜僢僪偐傜屇傃弌偝傟傑偡丅
* <BR>僥儞僾儗乕僩儊僜僢僪僷僞乕儞
*
* @param bf 僶僢僼傽乕儕乕僟乕
*/
public void Read(BufferedReader bf) throws GSException{
//BufferedReader bf = GSTextFile2.OpenLoad(file);
try {
_read(bf);
bf.close();
} catch(GSException e) {
throw e;
} catch(IOException e) {
throw new GSException("IO僄儔乕",e);
}
}
/**
* <p>僨乕僞傪撉傒崬傒傑偡丅
*
* @param bf 僶僢僼傽儕乕僟乕
*/
protected void _read(BufferedReader bf) throws GSException{
try {
String buf = new String();
String label,value;
for(buf=bf.readLine();buf!=null;buf=bf.readLine())
{
StringTokenizer st = new StringTokenizer(buf,"=");
label = st.nextToken();
if(st.hasMoreTokens())
value = st.nextToken();
else
value = "";
checkStore(label,value);
}
} catch(IOException e) {
throw new GSException("\"User file\"撉崬傒僄儔乕");
}
}
/**
* <p>僷儔儊乕僞傪僠僃僢僋偟傑偡丅
*
* @param label 僷儔儊乕僞柤
* @param value 僷儔儊乕僞抣
* @return boolean true:惓忢,false:埲忋
*/
protected boolean checkStore(String label,String value){
boolean ret=false;
if(label.equals(V1)){
setEntuserid(Integer.parseInt(value));
ret=true;
}else if(label.equals(V2)){
setAlocuserid(Integer.parseInt(value));
ret=true;
}else if(label.equals(V3)){
setAlocgroup(Integer.parseInt(value));
ret=true;
}else if(label.equals(V5)){
setEmployname(value);
ret=true;
}else if(label.equals(V6)){
setConame(value);
ret=true;
}else if(label.equals(V7)){
setCokname(value);
ret=true;
}else if(label.equals(V8)){
setBelong(value);
ret=true;
}else if(label.equals(V9)){
setPosition(value);
ret=true;
}else if(label.equals(V10)){
setName(value);
ret=true;
}else if(label.equals(V11)){
setKname(value);
ret=true;
}else if(label.equals(V12)){
setPostno(value);
ret=true;
}else if(label.equals(V13)){
setAddress1(value);
ret=true;
}else if(label.equals(V14)){
setAddress2(value);
ret=true;
}else if(label.equals(V15)){
setCotel(value);
ret=true;
}else if(label.equals(V16)){
setCofax(value);
ret=true;
}else if(label.equals(V17)){
setPbtel(value);
ret=true;
}else if(label.equals(V18)){
setPtel(value);
ret=true;
}else if(label.equals(V19)){
setMail(value);
ret=true;
}else if(label.equals(V20)){
setUrl(value);
ret=true;
}else if(label.equals(V21)){
setSecret(value);
ret=true;
}else if(label.equals(V22)){
setEdit(value);
ret=true;
}else if(label.equals(V23)){
setMemo(value);
ret=true;
}
return ret;
}
/**
* <p>僼傽僀儖偵儔僀僩偟傑偡丅
* <p>偙偺Write儊僜僢僪傪捈愙巊梡偡傞偙偲偼偁傝傑偣傫丅Save儊僜僢僪偐傜屇傃弌偝傟傑偡丅
* <BR>僥儞僾儗乕僩儊僜僢僪僷僞乕儞
*
* @param pw PrintWriter僆僽僕僃僋僩
*/
public synchronized void Write(PrintWriter pw) throws GSException{
pw.println(V1 + "=" + Integer.toString(entuserid));
pw.println(V2 + "=" + Integer.toString(alocuserid));
pw.println(V3 + "=" + Integer.toString(alocgroup));
pw.println(V5 + "=" + employname);
pw.println(V6 + "=" + coname);
pw.println(V7 + "=" + cokname);
pw.println(V8 + "=" + belong);
pw.println(V9 + "=" + position);
pw.println(V10 + "=" + name);
pw.println(V11 + "=" + kname);
pw.println(V12 + "=" + postno);
pw.println(V13 + "=" + address1);
pw.println(V14 + "=" + address2);
pw.println(V15 + "=" + cotel);
pw.println(V16 + "=" + cofax);
pw.println(V17 + "=" + pbtel);
pw.println(V18 + "=" + ptel);
pw.println(V19 + "=" + mail);
pw.println(V20 + "=" + url);
pw.println(V21 + "=" + secret);
pw.println(V22 + "=" + edit);
pw.println(V23 + "=" + GSHtml.ReturntoBR(memo));
}
/**
* <p>
*/
public void setContent(byte[] content) throws GSException{
try{
FileOutputStream fos = new FileOutputStream(filePath+"b");
BufferedOutputStream bos = new BufferedOutputStream(fos,content.length+1);
bos.write(content,0,content.length);
bos.flush();
bos.close();
}catch(FileNotFoundException e){
throw new GSException("僼傽僀儖偑尒偮偐傝傑偣傫丅",e);
}catch(IOException e){
throw new GSException("IO僄儔乕偱偡丅",e);
}
}
/**
* <p>嶍彍
*/
public synchronized void Delete() throws GSException{
if(file.exists())
file.delete();
}
/**
* <p>CSV宍幃偵僐儞僶乕僩
*/
public synchronized CDCsvData ConvCsv() throws GSException{
CDCsvData csvData = new CDCsvData(getEmployname(),getConame(),getCokname(),getBelong(),
getPosition(),getName(),getKname(),getPostno(),
getAddress1(),getAddress2(),getCotel(),getCofax(),
getPbtel(),getPtel(),getMail(),getUrl(),
getMemo());
return csvData;
}
/**
* <p>暥帤楍偺曄姺(僄儞僐乕僪)
*
* @param strPara 僄儞僐乕僪懳徾偺暥帤楍
* @return 僄儞僐乕僪偟偨暥帤楍
*/
public String chkStrEnc(String strPara){
strPara = GSHtml.transMsg(strPara);
strPara = GSHtml.ReturntoBR(strPara);
strPara = GSTool.delimitEncorde("=",strPara);
return strPara;
}
/**
* <p>暥帤楍偺曄姺(僨僐乕僪)
*
* @param strparam 僨僐乕僪懳徾偺暥帤楍
* @return 僨僐乕僪偟偨暥帤楍
*/
private String chkStrDec(String strparam){
strparam = GSTool.delimitDecorde("=",strparam);
strparam = GSHtml.BRtoReturn(strparam);
return strparam;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -