Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/data/exporter/LAFExporter.java @ 327:891a2133cf46
Added LAF exporter and LAF creator.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 27 Aug 2013 09:45:23 +0200 |
parents | |
children | 1feba681ffee |
comparison
equal
deleted
inserted
replaced
326:86cda4c57092 | 327:891a2133cf46 |
---|---|
1 package de.intevation.lada.data.exporter; | |
2 | |
3 import java.io.ByteArrayInputStream; | |
4 import java.io.File; | |
5 import java.io.IOException; | |
6 import java.io.InputStream; | |
7 import java.io.OutputStream; | |
8 import java.util.List; | |
9 import java.util.Map; | |
10 | |
11 import javax.inject.Inject; | |
12 import javax.inject.Named; | |
13 | |
14 import de.intevation.lada.auth.AuthenticationResponse; | |
15 import de.intevation.lada.model.LProbe; | |
16 | |
17 @Named("lafexporter") | |
18 public class LAFExporter | |
19 implements Exporter | |
20 { | |
21 | |
22 @Inject | |
23 @Named("lafcreator") | |
24 private Creator creator; | |
25 | |
26 @Override | |
27 public InputStream export( | |
28 String probe, | |
29 AuthenticationResponse auth | |
30 ) { | |
31 String laf = ""; | |
32 laf += creator.create(probe); | |
33 InputStream in = new ByteArrayInputStream(laf.getBytes()); | |
34 try { | |
35 in.close(); | |
36 } | |
37 catch (IOException e) { | |
38 //TODO Exception handling. | |
39 } | |
40 return in; | |
41 } | |
42 } |