com.sun.istack.internal.tools.DefaultAuthenticator Java Examples

The following examples show how to use com.sun.istack.internal.tools.DefaultAuthenticator. 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: Options.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #2
Source File: Options.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #3
Source File: Options.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #4
Source File: Options.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #5
Source File: Options.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @param args
     * @throws BadCommandLineException thrown when there's a problem in the command-line arguments
     */
    public void parseArguments(String[] args) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if (args[i].length() == 0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args, i);
                if (j == 0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j - 1);
            } else {
                if (args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i], grammars, ".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if (schemaLanguage == null)
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if (pluginLoadFailure != null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE, pluginLoadFailure));
    }
 
Example #6
Source File: Options.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #7
Source File: Options.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }
 
Example #8
Source File: Options.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Parses arguments and fill fields of this object.
     *
     * @exception BadCommandLineException
     *      thrown when there's a problem in the command-line arguments
     */
    public void parseArguments( String[] args ) throws BadCommandLineException {

        for (int i = 0; i < args.length; i++) {
            if(args[i].length()==0)
                throw new BadCommandLineException();
            if (args[i].charAt(0) == '-') {
                int j = parseArgument(args,i);
                if(j==0)
                    throw new BadCommandLineException(
                        Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                i += (j-1);
            } else {
                if(args[i].endsWith(".jar"))
                    scanEpisodeFile(new File(args[i]));
                else
                    addFile(args[i],grammars,".xsd");
            }
        }

        // configure proxy
        if (proxyHost != null || proxyPort != null) {
            if (proxyHost != null && proxyPort != null) {
                System.setProperty("http.proxyHost", proxyHost);
                System.setProperty("http.proxyPort", proxyPort);
                System.setProperty("https.proxyHost", proxyHost);
                System.setProperty("https.proxyPort", proxyPort);
            } else if (proxyHost == null) {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYHOST));
            } else {
                throw new BadCommandLineException(
                    Messages.format(Messages.MISSING_PROXYPORT));
            }
            if (proxyAuth != null) {
                DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
            }
        }

        if (grammars.isEmpty())
            throw new BadCommandLineException(
                Messages.format(Messages.MISSING_GRAMMAR));

        if( schemaLanguage==null )
            schemaLanguage = guessSchemaLanguage();

//        if(target==SpecVersion.V2_2 && !isExtensionMode())
//            throw new BadCommandLineException(
//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");

        if(pluginLoadFailure!=null)
            throw new BadCommandLineException(
                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
    }