Пример #1
0
 public void onPostajaChange() {
   novi = false;
   if (postaja != null) {
     programiSvi = postaja.getProgramMjerenjaCollection();
   } else {
     programiSvi = new ArrayList<>();
   }
 }
Пример #2
0
  public StreamedContent download() {

    pokupiPodatke();
    DefaultStreamedContent file = new DefaultStreamedContent();
    file.setContentType("application/csv");
    file.setName(postaja.getNazivPostaje().replace(' ', '_').toLowerCase().concat(".csv"));

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    CsvWriter csvWriter = new CsvWriter(os, ';', Charset.forName("utf-8"));

    pisiCsv(csvWriter);
    ByteArrayInputStream bis = new ByteArrayInputStream(os.toByteArray());
    file.setStream(bis);

    return file;
  }