?? savetemplate.java
字號(hào):
package com.saas.biz.saveTemplateFile;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import com.saas.biz.commen.commMethodMgr;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
public class saveTemplate {
Dbtable tradeQuery;
commMethodMgr comm;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public saveTemplate() {
log = new Logger(this);
tradeQuery = new Dbtable();
comm = new commMethodMgr();
}
public void setTradeQuery(Dbtable tradeQuery) {
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery() {
return this.tradeQuery;
}
public void setOutBuffer(Buffers outBuffer) {
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer() {
return this.outBuffer;
}
public ArrayList getQueryResult() {
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult) {
this.queryResult = queryResult;
}
public void saveTempFile(Buffers inbuffer) throws SaasApplicationException {
log.LOG_INFO("進(jìn)入addClewTrackInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String content = inbuffer.getString("CONTENT");
String file_path = inbuffer.getString("file_name");
try {
iResult = saveTempFile(file_path, content);
}
catch (Exception e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "業(yè)務(wù)處理失敗!");
}
else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "業(yè)務(wù)處理成功!");
}
log.LOG_INFO("退出addClewTrackInfo方法...");
}
public int saveTempFile(String path, String content) throws SaasApplicationException, IOException {
FileOutputStream fileoutputstream = null;
try {
fileoutputstream = new FileOutputStream(path);
byte abyte0[] = content.getBytes();
fileoutputstream.write(abyte0);
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
finally {
fileoutputstream.close();
}
return 0;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -