Package org.bladerunnerjs.utility

Examples of org.bladerunnerjs.utility.EncodedFileUtil


    this.confFile = confFile;
   
    try {
      // TODO: get rid of `node == null` guard once we delete no brjs-core code
      String fileEncoding = ((node == null) || confFile.getName().equals("brjs.conf")) ? "UTF-8" : node.root().bladerunnerConf().getDefaultFileCharacterEncoding();
      fileUtil = new EncodedFileUtil(fileEncoding);
    }
    catch(ConfigException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


import com.jamesmurty.utils.XMLBuilder;

public class AliasesWriter {
  public static void write(AliasesData data, File file, String defaultFileCharacterEncoding) throws IOException {
    try {
      EncodedFileUtil fileUtil = new EncodedFileUtil(defaultFileCharacterEncoding);
      XMLBuilder builder = XMLBuilder.create("aliases").ns("http://schema.caplin.com/CaplinTrader/aliases");
     
      if (data.scenario != null) {
        builder.a("useScenario", data.scenario);
      }
     
      if (!data.groupNames.isEmpty()) {
        builder.a("useGroups", Joiner.on(" ").join(data.groupNames));
      }
     
      for (AliasOverride aliasOverride : data.aliasOverrides) {
        XMLBuilder element = builder.e("alias").a("name", aliasOverride.getName());
       
        if(aliasOverride.getClassName() != null) {
          element.a("class", aliasOverride.getClassName());
        }
      }
     
      fileUtil.write(file, XmlBuilderSerializer.serialize(builder));
    } catch (ParserException | TransformerException | ParserConfigurationException | FactoryConfigurationError e) {
      throw new IOException(e);
    }
  }
View Full Code Here

import com.jamesmurty.utils.XMLBuilder;

public class AliasDefinitionsWriter {
  public static void write(AliasDefinitionsData data, File file, String defaultFileCharacterEncoding) throws IOException {
    try {
      EncodedFileUtil fileUtil = new EncodedFileUtil(defaultFileCharacterEncoding);
      XMLBuilder builder = XMLBuilder.create("aliasDefinitions").ns("http://schema.caplin.com/CaplinTrader/aliasDefinitions");
     
      for (AliasDefinition aliasDefinition : data.aliasDefinitions) {
        XMLBuilder aliasBuilder = builder.e("alias").a("name", aliasDefinition.getName());
        Map<String, AliasOverride> scenarioAliases = data.getScenarioAliases(aliasDefinition.getName());
       
        if(aliasDefinition.getClassName() != null) {
          aliasBuilder.a("defaultClass", aliasDefinition.getClassName());
        }
       
        if(aliasDefinition.getInterfaceName() != null) {
          aliasBuilder.a("interface", aliasDefinition.getInterfaceName());
        }
       
        for (String scenarioName : scenarioAliases.keySet()) {
          AliasOverride scenarioAlias = scenarioAliases.get(scenarioName);
          aliasBuilder.e("scenario").a("name", scenarioName).a("class", scenarioAlias.getClassName());
        }
      }
     
      for (String groupName : data.groupAliases.keySet()) {
        XMLBuilder groupBuilder = builder.e("group").a("name", groupName);
       
        for (AliasOverride groupAlias : data.groupAliases.get(groupName)) {
          groupBuilder.e("alias").a("name", groupAlias.getName()).a("class", groupAlias.getClassName());
        }
      }
     
      fileUtil.write(file, XmlBuilderSerializer.serialize(builder));
    }
    catch (IOException | ParserConfigurationException | FactoryConfigurationError | TransformerException e) {
      throw new IOException(e);
    }
  }
View Full Code Here

  public AssetContainerBuilder(SpecTest specTest, N node)
  {
    super(specTest, node);
   
    this.node = node;
    fileUtil = new EncodedFileUtil(specTest.getActiveCharacterEncoding());
  }
View Full Code Here

  private EncodedFileUtil fileUtil;
 
  public NodeBuilder(SpecTest specTest, N node) {
    this.specTest = specTest;
    this.node = node;
    fileUtil = new EncodedFileUtil(specTest.getActiveCharacterEncoding());
    builderChainer = new BuilderChainer(specTest);
  }
View Full Code Here

  private final N node;
  private final EncodedFileUtil fileUtil;
 
  public NodeVerifier(SpecTest specTest, N node) {
    this.node = node;
    fileUtil = new EncodedFileUtil(specTest.getActiveCharacterEncoding());
    verifierChainer = new VerifierChainer(specTest);
  }
View Full Code Here

  public FileTestBuilder(SpecTest specTest, File file) {
    super(specTest);
    this.file = file;
    builderChainer = new BuilderChainer(specTest);
    fileUtil = new EncodedFileUtil(specTest.getActiveCharacterEncoding());
  }
View Full Code Here

  protected final EncodedFileUtil fileUtil;
 
  public NodeCommander(SpecTest specTest, N node) {
    super(specTest);
    this.node = node;
    fileUtil = new EncodedFileUtil(specTest.getActiveCharacterEncoding());
    commanderChainer = new CommanderChainer(specTest);
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.utility.EncodedFileUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.