common/src/main/java/HTTPClient/DefaultAuthHandler.java
/*
     * Turn command-line echoing of typed characters on or off.
     */
Turn command-line echoing of typed characters on or off.
Turn command - line echoing of typed characters on or off .
private static void echo(boolean on)
    {
	String os = System.getProperty("os.name");
	String[] cmd = null;
	if (os.equalsIgnoreCase("Windows 95")  ||
	    os.equalsIgnoreCase("Windows NT"))
	    cmd = new String[] { "echo", on ? "on" : "off" };
	else if (os.equalsIgnoreCase("Windows")  ||
		 os.equalsIgnoreCase("16-bit Windows"))
	    ;	
	else if (os.equalsIgnoreCase("OS/2"))
	    ;	
	else if (os.equalsIgnoreCase("Mac OS")  ||
		 os.equalsIgnoreCase("MacOS"))
	    ;	
	else if (os.equalsIgnoreCase("OpenVMS") ||
		 os.equalsIgnoreCase("VMS"))
	    cmd = new String[] { "SET TERMINAL " + (on ? "/ECHO" : "/NOECHO") };
	else			
	    cmd = new String[] { "/bin/sh", "-c",
				 "stty " + (on ? "echo" : "-echo") + " < /dev/tty" };
        if (cmd != null)
	    try
		{ Runtime.getRuntime().exec(cmd).waitFor(); }
	    catch (Exception e)
		{ }
    }
private static void echo ( boolean on ) { String os = System . getProperty ( "os.name" ) ; String [ ] cmd = null ; if ( os . equalsIgnoreCase ( "Windows 95" ) || os . equalsIgnoreCase ( "Windows NT" ) ) cmd = new String [ ] { "echo" , on ? "on" : "off" } ; else if ( os . equalsIgnoreCase ( "Windows" ) || os . equalsIgnoreCase ( "16-bit Windows" ) ) ; else if ( os . equalsIgnoreCase ( "OS/2" ) ) ; else if ( os . equalsIgnoreCase ( "Mac OS" ) || os . equalsIgnoreCase ( "MacOS" ) ) ; else if ( os . equalsIgnoreCase ( "OpenVMS" ) || os . equalsIgnoreCase ( "VMS" ) ) cmd = new String [ ] { "SET TERMINAL " + ( on ? "/ECHO" : "/NOECHO" ) } ; else cmd = new String [ ] { "/bin/sh" , "-c" , "stty " + ( on ? "echo" : "-echo" ) + " < /dev/tty" } ; if ( cmd != null ) try { Runtime . getRuntime ( ) . exec ( cmd ) . waitFor ( ) ; } catch ( Exception e ) { } }
Turn command-line echoing of typed characters on or off.
Turn command - line echoing of typed characters on or off .
// I don't think this works on M$ ... // ??? // ??? // ??? // probably unix