⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 savetemplate.java

📁 java阿里巴巴代码
💻 JAVA
字号:
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("进入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", "业务处理失败!");
		}
		else {
			this.outBuffer.setInt("RESULT_CODE", 0);
			this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
		}
		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;
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -