org.das2.util.filesystem.KeyChain

class that contains the credentials for websites. This is first introduced so that ftp://papco:@mrfrench.lanl.gov/ and subdirectories would just ask for credentials once. Also, this allows all the sensitive information to be stored in one class.


addCookie

addCookie( String url, String cookie ) → void

Add a cookie for the URL. This was added as a work-around to provide access to the MMS data server at LASP.

Parameters

url -
cookie -

Returns:

void (returns nothing)

search for examples view on GitHub view source


clearAll

clearAll( ) → void

clear all passwords.

Returns:

void (returns nothing)

search for examples view on GitHub view source


clearUserPassword

clearUserPassword( java.net.URI uri ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


getUserInfo

getUserInfo( java.net.URI uri ) → String

get the user credentials, maybe throwing CancelledOperationException if the user hits cancel.

Parameters

uri -

Returns:

java.lang.String

search for examples view on GitHub view source


getUserInfoBase64Encoded

getUserInfoBase64Encoded( java.net.URL url ) → String

return the user info but base-64 encoded. This is put in so that a future version of the software can cache these as well. This is intended to be inserted like so: connection= theUrl.getConnection(); String encode= KeyChain.getDefault().getUserInfoBase64Encoded( theUrl ); if ( encode!=null ) connection.setRequestProperty("Authorization", "Basic " + encode);

Parameters

url - the URL which may contain user info.

Returns:

the base-64 encoded credentials.

search for examples view on GitHub view source


getWWWAuthenticate

getWWWAuthenticate( java.net.URL url ) → String

return null or the WWW-Authenticate string.

Parameters

url -

Returns:

java.lang.String

search for examples view on GitHub view source


hideUserInfo

hideUserInfo( java.net.URI root ) → String

Returns:

java.lang.String

search for examples view on GitHub view source


resolveUserInfo

resolveUserInfo( java.net.URI root ) → URI

plug the username and password into the URI.

Parameters

root - the URI, possibly needing a username and password.

Returns:

the URI with the username and password.

search for examples view on GitHub view source


setParentGUI

setParentGUI( java.awt.Component c ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


setUserInfo

setUserInfo( java.net.URL url, String userInfo ) → void

insert the userInfo into the table of stored passwords. TODO: note the path is not used in the hash, and it should be.

Parameters

url -
userInfo -

Returns:

void (returns nothing)

search for examples view on GitHub view source


writeKeysFile

writeKeysFile( ) → void

dump the loaded keys into the file new File( FileSystem.settings().getLocalCacheDir(), "keychain.txt" )

Returns:

void (returns nothing)

search for examples view on GitHub view source