<h2>org.das2.util.CredentialsManager</h2><p>Provides per-resource login credentials 
 
 This class maintains a map of login credentials by resource ID.  The resource ID's 
 themselves are just strings.  The only expectation on resource ID strings is that they
 should be suitable for use as the Keys to a hash map.  Otherwise no formation rules are
 assumed nor expected.  User names and passwords for multiple web-sites, ftp sites, etc.
 are maintained by a single instance of this class.  Call:
 
    CredentialsManager.getManager()
 
 to get a reference to that single instance.
 
 In a graphical environment this class handles presenting dialogs to the user to gather
 logon credentials.  In a shell environment it will interact with the TTY to get user
 information.  
 
 An example of using this class to handle Das 2.1 server authentication which html
 location information formatting follows:
 <code>
 
 CredentialsManage cm = CrentialsManager.getMannager();
 String sLocId = "planet.physics.uiowa.edu/das/das2Server|voyager1/pwi/SpecAnalyzer-4s-Efield";
 
 if(!cm.hasCredentials(sLocId)){
    DasServer svr = DasServer.create(sDsdf);
    String sDesc = String.Format("<html><h1>%s</h1><h3>Server:  %s</h3><h3>DataSource: %s</h3>",
                                 DasServer.getName(), "planet.physics.uiowa.edu",
                                 "voyager1 > pwi > SpecAnalyzer-4s-Efield");
    cm.setDescription(sLocId, sDesc, DasServer.getLogo());
 }
 
 String sHash = getHttpBasicHash(sLocId)
 
 </code>
 
 Two previous classes, org.das2.util.filesystem.KeyChain (autoplot) and
 org.das2.client.Authenticator have approached this problem as well.  However both of
 those classes make assumptions that are not valid in general.  The first assumes that
 the caller somehow knows the username.  The second assumes that you are talking to
 a first generation Das 2.1 server.  Details of server communication are beyond the 
 scope of this class.</p>
<hr>
<a name="getDas2UserDirectory"></a>
<h2>getDas2UserDirectory</h2>
getDas2UserDirectory(  ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/io/File.html'>java.io.File</a>

<p>returns the location of the local directory sandbox.  For example,
 The web filesystem object downloads temporary files to here, logging
 properties file, etc.

 Assume that this File is local, so I/O is quick, and that the process
 has write access to this area.
 For definition, assume that at least 1Gb of storage is available as
 well.</p>

<h3>Returns:</h3>
the directory.
<h3>See Also:</h3>
<a href='http://www-pw.physics.uiowa.edu/~jbf/autoplot/doc/org/das2/DasApplication.html#getDas2UserDirectory !'>org.das2.DasApplication#getDas2UserDirectory !</a> !<br>
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getDas2UserDirectory&unscoped_q=getDas2UserDirectory">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#getDas2UserDirectory">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="getHttpBasicHash"></a>
<h2>getHttpBasicHash</h2>
getHttpBasicHash( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a>

<p>Get credentials in the form of a hashed HTTP Basic authentication string
 
 If there are no credentials stored for the given location id, this function may
 trigger interaction with the user, such as presenting modal dialogs, or changing the
 TTY to non-echo.</p>

<h3>Parameters</h3>
sLocationId - A unique string identifying a location.  There are no formation
 rules on the string, but convenience functions are provided if a uniform naming 
 convention is desired.

<h3>Returns:</h3>
The string USERNAME + ":" + PASSWORD that is then run through a base64 
 encoding.  If no credentials are available for the given location ID and none can be 
 gathered from the user (possibly due to the java.awt.headless being set or the
 user pressing cancel), null is returned.
<h3>See Also:</h3>
<a href='null'>getHttpBasicHashRaw(java.lang.String)</a> <br>
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getHttpBasicHash&unscoped_q=getHttpBasicHash">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#getHttpBasicHash">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="getHttpBasicHashRaw"></a>
<h2>getHttpBasicHashRaw</h2>
getHttpBasicHashRaw( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a>

<p>Get credentials in the form of a hashed HTTP Basic authentication string.

 If there are no credentials stored for the given location id, this function
 may trigger interaction with the user, such as presenting modal dialogs, or
 changing the TTY to non-echo.</p>

<h3>Parameters</h3>
sLocationId - A unique string identifying a location. There are no formation
 rules on the string, but convenience functions are provided if a uniform naming
 convention is desired.

<h3>Returns:</h3>
The string USERNAME + ":" + PASSWORD. If no credentials are available for
 the given location ID and none can be gathered from the user (possibly due to the
 java.awt.headless being set or the user pressing cancel), null is returned.
<h3>See Also:</h3>
<a href='null'>getHttpBasicHash(java.lang.String)</a> <br>
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getHttpBasicHashRaw&unscoped_q=getHttpBasicHashRaw">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#getHttpBasicHashRaw">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="getMannager"></a>
<h2>getMannager</h2>
getMannager(  ) &rarr; <a href='http://www-pw.physics.uiowa.edu/~jbf/autoplot/doc/org/das2/util/CredentialsManager.html'>org.das2.util.CredentialsManager</a>

<p>Get a reference to the authentication manager.  
 
 Typically this is the function you want to use to get started.</p>

<h3>Returns:</h3>
org.das2.util.CredentialsManager

<br><br>
<a href="https://github.com/autoplot/dev/search?q=getMannager&unscoped_q=getMannager">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#getMannager">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
getMannager( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sWhich ) &rarr; <a href='http://www-pw.physics.uiowa.edu/~jbf/autoplot/doc/org/das2/util/CredentialsManager.html'>org.das2.util.CredentialsManager</a><br>
<hr>
<a name="getProperty"></a>
<h2>getProperty</h2>
getProperty( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> name, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> deft ) &rarr; <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a>

<p>support restricted security environment by checking permissions before 
 checking property.</p>

<h3>Parameters</h3>
name - a String
<br>
deft - a String

<h3>Returns:</h3>
a String

<h3>See Also:</h3>
<a href='http://www-pw.physics.uiowa.edu/~jbf/autoplot/doc/org/das2/DasApplication.html#getProperty !'>org.das2.DasApplication#getProperty !</a> !<br>
<br><br>
<a href="https://github.com/autoplot/dev/search?q=getProperty&unscoped_q=getProperty">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#getProperty">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="hasCredentials"></a>
<h2>hasCredentials</h2>
hasCredentials( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; boolean

<p>Determine if there are any stored credentials for this location 
 
 If either a username or a password have been provided for the location
 then it is considered to have credentials</p>

<h3>Parameters</h3>
sLocationId - The location to describe, can not be null.

<h3>Returns:</h3>
true if there are stored credentials, false otherwise
<br><br>
<a href="https://github.com/autoplot/dev/search?q=hasCredentials&unscoped_q=hasCredentials">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#hasCredentials">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="hasDescription"></a>
<h2>hasDescription</h2>
hasDescription( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; boolean

<p>Determine if a given location has been described
 
 Gathering descriptive information about a remote location may trigger communication
 with a remote site.  Use this function to see if such communication is needed.</p>

<h3>Parameters</h3>
sLocationId - The location in question

<h3>Returns:</h3>
true if the location has been described, false otherwise
<br><br>
<a href="https://github.com/autoplot/dev/search?q=hasDescription&unscoped_q=hasDescription">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#hasDescription">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="hasIcon"></a>
<h2>hasIcon</h2>
hasIcon( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; boolean

<p>Determine is a site image has been set for a location ID.  
 
 This function is provided because retrieving the logo for a site may trigger remote
 host communication.  Use this function to see if such communication is needed.</p>

<h3>Parameters</h3>
sLocationId - the location in question

<h3>Returns:</h3>
true if the location has as attached icon logo
<br><br>
<a href="https://github.com/autoplot/dev/search?q=hasIcon&unscoped_q=hasIcon">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#hasIcon">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="invalidate"></a>
<h2>invalidate</h2>
invalidate( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId ) &rarr; void

<p>Let the credentials manager know that stored credentials for a location are invalid</p>

<h3>Parameters</h3>
sLocationId - a String

<h3>Returns:</h3>
a void

<br><br>
<a href="https://github.com/autoplot/dev/search?q=invalidate&unscoped_q=invalidate">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#invalidate">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
<hr>
<a name="setDescription"></a>
<h2>setDescription</h2>
setDescription( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sDescription ) &rarr; void

<p>Provide a description of a location for use in authentication dialogs.
 
 Use this function to tie a string description to a location id.  This description
 will be used when interacting with the user.  If no description is present, then just
 the location ID itself will be used to identify the site to the end user.
 Usually location strings aren't that easy to read so use of this function or the
 version with an icon argument is recommended, though not required.</p>

<h3>Parameters</h3>
sLocationId - The location to describe, can not be null.
<br>
sDescription - A string to present to a user when prompting for a credentials
 for this location, may be a basic HTML string.

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=setDescription&unscoped_q=setDescription">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#setDescription">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>
setDescription( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sDescription, <a href='http://www-pw.physics.uiowa.edu/~jbf/autoplot/doc/javax/swing/ImageIcon.html'>javax.swing.ImageIcon</a> icon ) &rarr; void<br>
<hr>
<a name="setHttpBasicHashRaw"></a>
<h2>setHttpBasicHashRaw</h2>
setHttpBasicHashRaw( <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> sLocationId, <a href='https://docs.oracle.com/javase/8/docs/api/java/lang/String.html'>String</a> userInfo ) &rarr; void

<p>Allow scripts to set username and password.</p>

<h3>Parameters</h3>
sLocationId - the location/realm, like "http://jupiter.physics.uiowa.edu/das/server|Juno Magnetospheric Working Group"
<br>
userInfo - the user pass in string like "usern:passw"

<h3>Returns:</h3>
void (returns nothing)

<br><br>
<a href="https://github.com/autoplot/dev/search?q=setHttpBasicHashRaw&unscoped_q=setHttpBasicHashRaw">[search for examples]</a>
 <a href="https://github.com/autoplot/documentation/tree/master/javadoc/org/das2/util/CredentialsManager.md">[view on GitHub]</a>
 <a href="http://www-pw.physics.uiowa.edu/~jbf/autoplot/javadoc2018/org/das2/util/CredentialsManager.html#setHttpBasicHashRaw">[view on old javadoc]</a>
 <a href="https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2011/trunk/dasCoreUtil/src/org/das2/util/CredentialsManager.java">[view source]</a>
<br>
<br>