Package org.sonatype.security.model.io.xpp3

Examples of org.sonatype.security.model.io.xpp3.SecurityConfigurationXpp3Reader


       
        try
        {
            in = toStream( location );
           
            SettingsSecurity sec = new SecurityConfigurationXpp3Reader().read( in );
           
            in.close();
           
            if( cycle && sec.getRelocation() != null )
                return read( sec.getRelocation(), true );
View Full Code Here


    setConfigurationUpgraded(false);

    Reader fr = null;

    try {
      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      fr = new InputStreamReader(is);

      configuration = reader.read(fr);
    }
    catch (XmlPullParserException e) {
      rejectConfiguration("Security configuration file was not loaded, it has the wrong structure.");

      if (getLogger().isDebugEnabled()) {
View Full Code Here

    try {
      // reading without interpolation to preserve user settings as variables
      r = new BufferedReader(ReaderFactory.newXmlReader(file));

      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      return reader.read(r);
    }
    catch (XmlPullParserException e) {
      throw new ConfigurationIsCorruptedException(file.getAbsolutePath(), e);
    }
    finally {
View Full Code Here

    Reader fr = null;
    Configuration configuration = null;

    try {
      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      fr = new InputStreamReader(new FileInputStream(secConfigFile));

      // read again with interpolation
      try {
        configuration = reader.read(fr);
      }
      finally {
        fr.close();
      }
View Full Code Here

  }

  protected Configuration getConfigurationFromStream(InputStream is)
      throws Exception
  {
    SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

    Reader fr = new InputStreamReader(is);

    return reader.read(fr);
  }
View Full Code Here

      assert url != null;

      log.debug("Loading static security configuration: {}", url);
      try (InputStream is = url.openStream();
           Reader fr = new InputStreamReader(is)) {
        SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();
        return reader.read(fr);
      }
      catch (Exception e) {
        log.error("Failed to read configuration", e);
      }
    }
View Full Code Here

  }

  protected Configuration getConfigurationFromStream(InputStream is)
      throws Exception
  {
    SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

    Reader fr = new InputStreamReader(is);

    return reader.read(fr);
  }
View Full Code Here

  protected Configuration getSecurityConfiguration()
      throws IOException, XmlPullParserException
  {
    // now lets check the XML file for the user and the role mapping
    SecurityConfigurationXpp3Reader secReader = new SecurityConfigurationXpp3Reader();
    try (FileReader fileReader = new FileReader(new File(CONFIG_DIR, "security.xml"))) {
      return secReader.read(fileReader);
    }
  }
View Full Code Here

    Configuration config = null;

    String userId = null;

    try (FileInputStream fis = new FileInputStream(securityXML)) {
      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();
      config = reader.read(fis);
    }

    try (FileWriter fileWriter = new FileWriter(securityXML)) {
      config.getUsers().get(0).setEmail("testLoadConfigWithInvalidEmail");
      userId = config.getUsers().get(0).getId();
View Full Code Here

    setConfigurationUpgraded(false);

    Reader fr = null;

    try {
      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      fr = new InputStreamReader(is);

      configuration = reader.read(fr);
    }
    catch (XmlPullParserException e) {
      rejectConfiguration("Security configuration file was not loaded, it has the wrong structure.");

      if (getLogger().isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of org.sonatype.security.model.io.xpp3.SecurityConfigurationXpp3Reader

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.