geoportal-data-common/src/main/java/org/gcube/application/geoportalcommon/MockDocumentConfigurationRe...

71 lines
2.4 KiB
Java

//package org.gcube.application.geoportalcommon;
//
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.util.ArrayList;
//import java.util.List;
//
//import org.gcube.application.geoportalcommon.shared.geoportal.config.DocumentConfigDV;
//
//public class MockDocumentConfigurationReader {
//
// private List<DocumentConfigDV> listDocumentConfigsDV = new ArrayList<DocumentConfigDV>();
//
// public MockDocumentConfigurationReader() {
// try {
// //loadDocumentConfiguration();
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
//
//// //THIS IS A MOCK
//// private void loadDocumentConfiguration() throws Exception {
//// System.out.println("loadDocumentConfiguration called");
//// String filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config.json";
////
//// DocumentConfigDV dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config2.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config3.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config4.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
//// }
////
//// private DocumentConfigDV getDocumentConfigVO(String filePath) throws JsonProcessingException, IOException {
//// String theFile = readFile(filePath);
//// System.out.println("the file is: " + theFile);
//// DocumentConfig dc = org.gcube.application.geoportal.client.utils.Serialization.read(theFile,
//// DocumentConfig.class);
//// System.out.println(dc);
////
//// return ConvertToDataValueObjectModel.toDocumentConfigDV(dc);
//// }
//
// public static String readFile(String filePath) {
// String content = "";
//
// try {
// content = new String(Files.readAllBytes(Paths.get(filePath)));
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// return content;
// }
//
// public List<DocumentConfigDV> getListDocumentConfig() {
// return listDocumentConfigsDV;
// }
//}