当前位置: 首页>>代码示例>>Java>>正文


Java Config.get方法代码示例

本文整理汇总了Java中sun.security.krb5.Config.get方法的典型用法代码示例。如果您正苦于以下问题:Java Config.get方法的具体用法?Java Config.get怎么用?Java Config.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.security.krb5.Config的用法示例。


在下文中一共展示了Config.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import sun.security.krb5.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") + "/krb5.conf");
    Config config = Config.getInstance();
    config.listTable();

    String sample = "kdc.example.com kdc2.example.com";
    for ( int i = 0; i < 4; i++ ) {
        String expected = config.getAll("realms", "EXAMPLE_" + i + ".COM", "kdc");
        if (!sample.equals(expected)) {
            throw new Exception("krb5.conf: unexpected kdc value \"" +
                    expected + "\"");
        }
    }

    // JDK-8055045: IOOBE when reading an empty value
    config.get("empty1", "NOVAL.COM");
    config.get("empty2", "NOVAL.COM");
    config.get("quote1", "NOVAL.COM");
    config.get("quote2", "NOVAL.COM");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:22,代码来源:ParseConfig.java

示例2: initStatic

import sun.security.krb5.Config; //导入方法依赖的package包/类
public static void initStatic() {
    boolean allowed = false;
    try {
        Config cfg = Config.getInstance();
        String temp = cfg.get("libdefaults", "allow_weak_crypto");
        if (temp != null && temp.equals("true")) allowed = true;
    } catch (Exception exc) {
        if (DEBUG) {
            System.out.println ("Exception in getting allow_weak_crypto, " +
                                "using default value " +
                                exc.getMessage());
        }
    }
    allowWeakCrypto = allowed;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:EType.java

示例3: main

import sun.security.krb5.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/k1.conf");
    Config config = Config.getInstance();
    config.listTable();
    String s;

    // Latter overwrites former for root section
    s = config.get("libdefaults", "default_realm");
    if (s != null) {
        throw new Exception();
    }
    // Latter overwrites former for strings
    s = config.get("libdefaults", "default_tkt_enctypes");
    if (!s.equals("aes256-cts")) {
        throw new Exception();
    }
    // Latter overwrites former for sub-section
    s = config.get("realms", "R1", "kdc");
    if (!s.equals("k2")) {
        throw new Exception(s);
    }
    // Duplicate keys in [realms] are merged
    s = config.getAll("realms", "R2", "kdc");
    if (!s.equals("k1 k2 k3 k4")) {
        throw new Exception(s);
    }
    // Duplicate keys in [capaths] are merged
    s = config.getAll("capaths", "R1", "R2");
    if (!s.equals("R3 R4 R5 R6")) {
        throw new Exception(s);
    }
    // We can be very deep now
    s = config.get("new", "x", "y", "z", "a", "b", "c");
    if (!s.equals("d")) {
        throw new Exception(s);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:39,代码来源:Duplicates.java

示例4: main

import sun.security.krb5.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/k1.conf");
    Config config = Config.getInstance();
    config.listTable();
    String s;

    // root section merged
    s = config.get("libdefaults", "default_realm");
    if (!s.equals("R1")) {
        throw new Exception();
    }
    // Former is preferred to latter for strings and sections
    s = config.get("libdefaults", "default_tkt_enctypes");
    if (!s.equals("aes128-cts")) {
        throw new Exception();
    }
    s = config.get("realms", "R1", "kdc");
    if (!s.equals("k1")) {
        throw new Exception(s);
    }
    // Duplicate keys in [realms] are merged, and sections with the same
    // name in between ignored
    s = config.getAll("realms", "R2", "kdc");
    if (!s.equals("k1 k2 k3 k4")) {
        throw new Exception(s);
    }
    // Duplicate keys in [capaths] are merged
    s = config.getAll("capaths", "R1", "R2");
    if (!s.equals("R3 R4 R5 R6")) {
        throw new Exception(s);
    }
    // We can be very deep now
    s = config.get("new", "x", "y", "z", "a", "b", "c");
    if (!s.equals("d")) {
        throw new Exception(s);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:Duplicates.java

示例5: main

import sun.security.krb5.Config; //导入方法依赖的package包/类
public static void main(String[] args) throws Throwable {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") + "/comments.conf");
    Config config = Config.getInstance();
    config.get("section", "value");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:Semicolon.java


注:本文中的sun.security.krb5.Config.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。