Mercurial > lada > lada-server
view src/main/java/de/intevation/lada/data/exporter/LAFExporter.java @ 409:183f8116d9a6
Added license header to source files.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 20 Jan 2014 12:27:00 +0100 |
parents | f3d0894d9bfc |
children |
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=3) * and comes with ABSOLUTELY NO WARRANTY! Check out * the documentation coming with IMIS-Labordaten-Application for details. */ package de.intevation.lada.data.exporter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import de.intevation.lada.auth.AuthenticationResponse; import de.intevation.lada.model.LProbe; /** * The LAF exporter implements {@link Exporter} to produce a LAF file. * * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> */ @Named("lafexporter") public class LAFExporter implements Exporter { @Inject @Named("lafcreator") private Creator creator; /** * Export the {@link LProbe} objects. * * @param proben List of probe ids. * @param auth The authentication information. * @return InputStream with the LAF data. */ @Override public InputStream export( List<String> proben, AuthenticationResponse auth ) { String laf = ""; for (String probeId: proben) { laf += creator.create(probeId); } InputStream in = new ByteArrayInputStream(laf.getBytes()); try { in.close(); } catch (IOException e) { //TODO Exception handling. } return in; } }