| | |
| | | import com.google.gson.Gson; |
| | | import de.uhilger.mediaz.App; |
| | | import de.uhilger.mediaz.Server; |
| | | import de.uhilger.mediaz.entity.Ablage; |
| | | import de.uhilger.mediaz.entity.Ablageort; |
| | | import de.uhilger.mediaz.entity.ConfigurationElement; |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.FileReader; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | |
| | | private static final Logger logger = Logger.getLogger(Store.class.getName()); |
| | | |
| | | |
| | | private static final String typeAblage = "Ablage"; |
| | | private static final String typeAblageort = "Ablageort"; |
| | | |
| | | /** |
| | | * Ein Objekt als JSON in eine Datei schreiben |
| | |
| | | String json = sb.toString(); |
| | | Gson gson = new Gson(); |
| | | switch(type) { |
| | | case typeAblage: |
| | | return gson.fromJson(json, Ablage.class); |
| | | case typeAblageort: |
| | | return gson.fromJson(json, Ablageort.class); |
| | | default: |
| | | Ablage ablage = new Ablage(); |
| | | Ablageort ablage = new Ablageort(); |
| | | ablage.setName("Test"); |
| | | return ablage; |
| | | } |