?? fileserviceimpl.java
字號:
package com.richard.business.impl;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import com.richard.business.IFileService;
import com.richard.model.TFile;
public class FileServiceImpl implements IFileService {
private com.richard.model.TFileDAO dao;
public void setDao(com.richard.model.TFileDAO dao) {
this.dao = dao;
}
public void create(TFile tFile) {
this.dao.save(tFile);
}
public List getAllFile() {
return this.dao.findAll();
}
public String getFileName(Long fileId) {
return this.dao.findById(fileId).getFileName();
}
public void write(OutputStream os, Long fileId) {
TFile tfile = this.dao.findById(fileId);
try {
os.write(tfile.getFileContent());
os.flush();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -