Java Code Examples for sun.security.util.ResourcesMgr#getAuthResourceString()

The following examples show how to use sun.security.util.ResourcesMgr#getAuthResourceString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigFile.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void init(URL config,
                  Map<String, List<AppConfigurationEntry>> newConfig)
                  throws IOException {

    try (InputStreamReader isr
            = new InputStreamReader(getInputStream(config), UTF_8)) {
        readConfig(isr, newConfig);
    } catch (FileNotFoundException fnfe) {
        if (debugConfig != null) {
            debugConfig.println(fnfe.toString());
        }
        throw new IOException(ResourcesMgr.getAuthResourceString
            ("Configuration.Error.No.such.file.or.directory"));
    }
}
 
Example 2
Source File: SubjectCodeSource.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Return a String representation of this <code>SubjectCodeSource</code>.
 *
 * <p>
 *
 * @return a String representation of this <code>SubjectCodeSource</code>.
 */
public String toString() {
    String returnMe = super.toString();
    if (getSubject() != null) {
        if (debug != null) {
            final Subject finalSubject = getSubject();
            returnMe = returnMe + "\n" +
                    java.security.AccessController.doPrivileged
                            (new java.security.PrivilegedAction<String>() {
                            public String run() {
                                return finalSubject.toString();
                            }
                    });
        } else {
            returnMe = returnMe + "\n" + getSubject().toString();
        }
    }
    if (principals != null) {
        ListIterator<PrincipalEntry> li = principals.listIterator();
        while (li.hasNext()) {
            PrincipalEntry pppe = li.next();
            returnMe = returnMe + ResourcesMgr.getAuthResourceString("NEWLINE") +
                    pppe.getPrincipalClass() + " " +
                    pppe.getPrincipalName();
        }
    }
    return returnMe;
}
 
Example 3
Source File: ConfigFile.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void init(URL config,
                  Map<String, List<AppConfigurationEntry>> newConfig)
                  throws IOException {

    try (InputStreamReader isr
            = new InputStreamReader(getInputStream(config), "UTF-8")) {
        readConfig(isr, newConfig);
    } catch (FileNotFoundException fnfe) {
        if (debugConfig != null) {
            debugConfig.println(fnfe.toString());
        }
        throw new IOException(ResourcesMgr.getAuthResourceString
            ("Configuration.Error.No.such.file.or.directory"));
    }
}
 
Example 4
Source File: SubjectCodeSource.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a String representation of this <code>SubjectCodeSource</code>.
 *
 * <p>
 *
 * @return a String representation of this <code>SubjectCodeSource</code>.
 */
public String toString() {
    String returnMe = super.toString();
    if (getSubject() != null) {
        if (debug != null) {
            final Subject finalSubject = getSubject();
            returnMe = returnMe + "\n" +
                    java.security.AccessController.doPrivileged
                            (new java.security.PrivilegedAction<String>() {
                            public String run() {
                                return finalSubject.toString();
                            }
                    });
        } else {
            returnMe = returnMe + "\n" + getSubject().toString();
        }
    }
    if (principals != null) {
        ListIterator<PrincipalEntry> li = principals.listIterator();
        while (li.hasNext()) {
            PrincipalEntry pppe = li.next();
            returnMe = returnMe + ResourcesMgr.getAuthResourceString("NEWLINE") +
                    pppe.getPrincipalClass() + " " +
                    pppe.getPrincipalName();
        }
    }
    return returnMe;
}
 
Example 5
Source File: ConfigFile.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private IOException ioException(String resourceKey, Object... args) {
    MessageFormat form = new MessageFormat(
        ResourcesMgr.getAuthResourceString(resourceKey));
    return new IOException(form.format(args));
}
 
Example 6
Source File: ConfigFile.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private IOException ioException(String resourceKey, Object... args) {
    MessageFormat form = new MessageFormat(
        ResourcesMgr.getAuthResourceString(resourceKey));
    return new IOException(form.format(args));
}