本文整理匯總了Java中org.zkoss.zul.Filedownload.save方法的典型用法代碼示例。如果您正苦於以下問題:Java Filedownload.save方法的具體用法?Java Filedownload.save怎麽用?Java Filedownload.save使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.zkoss.zul.Filedownload的用法示例。
在下文中一共展示了Filedownload.save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: ByteArrayInputStream
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
/**
* Descarga fichero.
*/
public final void onClick$btnDescargarPlantilla() {
if (plantillaIdioma != null) {
final InputStream is = new ByteArrayInputStream(plantillaIdioma.getArchivo().getDatos());
Filedownload.save(is, "application/octet-stream", plantillaIdioma.getNombreFichero());
}
}
開發者ID:GovernIB,項目名稱:sistra,代碼行數:10,
示例2: sendAuditFile
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void sendAuditFile(User user, FiscalPeriod fiscalPeriod) {
auditLogger.log(SEND_AUDIT_FILE, user);
try {
List allCosts = new ArrayList<>();
if (fiscalPeriod != null) {
allCosts = costDao.getCostsInPeriod(fiscalPeriod);
// TODO: sort costs
}
List customers = customerDao.findAll(user);
String message = createAuditFile(allCosts, customers, user);
Filedownload.save(message, "XAF", user.getCompanyName());
} catch (Exception e) {
e.printStackTrace();
}
}
開發者ID:beemsoft,項目名稱:techytax-zk,代碼行數:16,
示例3: doExport
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Listen("onClick = #exportExcel")
public void doExport() throws IOException{
Exporter exporter = Exporters.getExporter();
Book book = ss.getBook();
File file = File.createTempFile(Long.toString(System.currentTimeMillis()),"temp");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
exporter.export(book, fos);
}finally{
if(fos!=null){
fos.close();
}
}
//generate file name upon book type (2007,2003)
String dlname = BookUtil.suggestName(book);
Filedownload.save(new AMedia(dlname, "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", file, true));
}
開發者ID:zkoss,項目名稱:zssessentials,代碼行數:19,
示例4: exportSearchResultToCsv
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
public void exportSearchResultToCsv() throws Exception {
Client client = getClient();
if (client == null)
return;
AbstractResultSearch> result = (AbstractResultSearch>) getResult();
if (result == null)
return;
PrintWriter pw = null;
try {
File tempFile = File.createTempFile("OSS_Search_Result", ".csv");
pw = new PrintWriter(tempFile);
new RenderCSV(result).render(pw);
Filedownload.save(new FileInputStream(tempFile),
"text/csv; charset-UTF-8", "OSS_Search_Result.csv");
} finally {
if (pw != null)
pw.close();
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:22,
示例5: onExportSiteMap
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void onExportSiteMap()
throws IOException, SearchLibException, TransformerConfigurationException, SAXException {
synchronized (this) {
UrlManager urlManager = getUrlManager();
if (urlManager == null)
return;
AbstractSearchRequest searchRequest = getSearchRequest(SearchTemplate.urlExport);
File file = urlManager.exportSiteMap(searchRequest);
Filedownload.save(new FileInputStream(file), "text/xml; charset-UTF-8", "OSS_SiteMap.xml");
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:12,
示例6: onExportURLs
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void onExportURLs() throws IOException, SearchLibException {
synchronized (this) {
UrlManager urlManager = getUrlManager();
if (urlManager == null)
return;
AbstractSearchRequest searchRequest = getSearchRequest(SearchTemplate.urlExport);
File file = urlManager.exportURLs(searchRequest);
try {
Filedownload.save(new FileInputStream(file), "text/plain; charset-UTF-8", "OSS_URLs_Export.txt");
} finally {
file.delete();
}
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:15,
示例7: onDownload
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
public void onDownload()
throws IOException, InterruptedException, SearchLibException, URISyntaxException, JSONException {
synchronized (this) {
if (!checkNotRunning())
return;
if (!checkCrawlCacheEnabled())
return;
DownloadItem downloadItem = getClient().getCrawlCacheManager().getItem(LinkUtils.newEncodedURI(url)).load();
if (downloadItem == null) {
new AlertController("No content", Messagebox.EXCLAMATION);
return;
}
Filedownload.save(downloadItem.getContentInputStream(), downloadItem.getContentBaseType(), "crawl.cache");
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:17,
示例8: onExportReport
點讚 3
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
public void onExportReport() throws SearchLibException, IOException {
PrintWriter pw = null;
try {
File tempFile = File.createTempFile("OSS_Query_Reports", "csv");
pw = new PrintWriter(tempFile);
for (Map.Entry facetItem : reportList) {
pw.print('"');
pw.print(facetItem.getKey().replaceAll("\"", "\"\""));
pw.print('"');
pw.print(',');
pw.println(facetItem.getValue().count);
}
pw.close();
pw = null;
Filedownload.save(new FileInputStream(tempFile), "text/csv; charset-UTF-8", "OSS_Query_Reports.csv");
} finally {
IOUtils.close(pw);
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:21,
示例9: export
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Listen("onClick = #exportButton")
public void export() throws IOException {
Exporter excelExporter = Exporters.getExporter("excel");
File file = new File("exported.xlsx");
FileOutputStream fos = new FileOutputStream(file);
excelExporter.export(ss.getBook(), fos);
Filedownload.save(file, "application/excel");
}
開發者ID:zkoss,項目名稱:zssessentials,代碼行數:9,
示例10: onDownload
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
public void onDownload() throws FileNotFoundException {
Filedownload.save(new FileInputStream(tempFile), null, FilenameUtils.getName(uri.getPath()));
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:5,
示例11: onExportCrawlCache
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void onExportCrawlCache() throws SearchLibException, IOException {
synchronized (this) {
UrlManager urlManager = getUrlManager();
if (urlManager == null)
return;
AbstractSearchRequest searchRequest = getSearchRequest(SearchTemplate.urlExport);
File file = urlManager.exportCrawlCache(searchRequest);
try {
Filedownload.save(new FileInputStream(file), "application/zip", "OSS_Crawl_Export.zip");
} finally {
file.delete();
}
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:15,
示例12: onDownload
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
public void onDownload() throws IOException, SearchLibException {
String filePath = Logging.getLogDirectory() + File.separator
+ getSelectedFile();
Filedownload.save(new File(filePath), "text/plain");
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:7,
示例13: onExport
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
@Command
@NotifyChange("*")
public void onExport() throws IOException, SearchLibException {
synchronized (this) {
final Client client = getClient();
if (client == null)
return;
final String currentField = getCurrentField();
if (currentField == null)
return;
File tempFile = File.createTempFile("OSS_term_freq", ".csv");
;
try (final PrintWriter pw = new PrintWriter(tempFile)) {
client.termEnum(new Term(currentField, getSearchTerm()), termEnum -> {
while (termEnum.term() != null) {
if (!termEnum.term().field().equals(currentField))
break;
pw.print('"');
pw.print(termEnum.term().text().replaceAll("\"", "\"\""));
pw.print('"');
pw.print(',');
pw.println(termEnum.docFreq());
if (!termEnum.next())
break;
}
});
pw.close();
Filedownload.save(new FileInputStream(tempFile), "text/csv; charset-UTF-8",
"OSS_term_freq_" + currentField + ".csv");
}
}
}
開發者ID:jaeksoft,項目名稱:opensearchserver,代碼行數:38,
示例14:
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void onClick$htmlDownload (Event e) throws Exception{
Tournament tournament = (Tournament) session.getAttribute("tournament");
RankingUtils.updatePlayersRanking(tournament.roundsList, tournament.players);
File exportFile = ExportUtils.exportAsHTML(tournament);
Filedownload.save(exportFile, "text/plain");
}
開發者ID:Meijinfr,項目名稱:Run4WinTournamentManager,代碼行數:7,
示例15:
點讚 2
import org.zkoss.zul.Filedownload; //導入方法依賴的package包/類
public void onClick$printAppariement (Event e) throws Exception{
File roundFile = ExportUtils.exportMatchesAsHTML(round);
Filedownload.save(roundFile, "application/excel");
}
開發者ID:Meijinfr,項目名稱:Run4WinTournamentManager,代碼行數:5,
注:本文中的org.zkoss.zul.Filedownload.save方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。