19 package org.turro.alliance;
21 import java.io.IOException;
22 import java.io.Reader;
23 import java.io.Writer;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.turro.configuration.JsonConfiguration;
27 import org.turro.elephant.context.ElephantContext;
28 import org.turro.file.Document;
41 return load().unsecured;
46 private boolean server;
48 private boolean unsecured;
52 private static final String ALLIANCE_CONTEXT =
"/WEB-INF/elephant/alliance/context.json";
57 try(Reader reader = file.reader()) {
59 }
catch (IOException ex) {
60 Logger.getLogger(AllianceContext.class.getName()).log(Level.SEVERE,
null, ex);
64 return new AllianceContext();
68 private static void save(AllianceContext context) {
69 Document file = Document.from(ElephantContext.getRealPath(ALLIANCE_CONTEXT));
70 file.folder().ensure();
71 try(Writer writer = file.writer()) {
72 JsonConfiguration.write(writer, context);
73 }
catch (IOException ex) {
74 Logger.getLogger(AllianceContext.class.getName()).log(Level.SEVERE,
null, ex);
static boolean isUnsecured()
static boolean isServer()
static String getRealPath(String path)