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.
KeyChain( )
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 - a String
cookie - a String
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
clearAll
clearAll( ) → void
clear all passwords.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
clearUserPassword
clearUserPassword( java.net.URI uri ) → void
Parameters
uri - an URI
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
clearUserPassword( java.net.URL url ) → void
getDefault
getDefault( ) → KeyChain
get the single instance of the class.
Returns:
the single instance of the class.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getInstance
getInstance( String name ) → KeyChain
get the instance for this name. This is added to support future applications, such as servlets, where
multiple users are using the same process.
Parameters
name - a String
Returns:
an org.das2.util.filesystem.KeyChain
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getUserInfo
getUserInfo( java.net.URI uri ) → String
get the user credentials, maybe throwing CancelledOperationException if the
user hits cancel.
Parameters
uri - an URI
Returns:
a String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getUserInfo( java.net.URL url ) → String
getUserInfo( java.net.URL url, String userInfo ) → String
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 on old javadoc]
[view source]
getWWWAuthenticate
getWWWAuthenticate( java.net.URL url ) → String
return null or the WWW-Authenticate string.
Parameters
url - an URL
Returns:
a String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
hideUserInfo
hideUserInfo( java.net.URI root ) → String
Parameters
root - an URI
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
main
main( java.lang.String[] args ) → void
Parameters
args - a java.lang.String[]
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
setParentGUI
setParentGUI( java.awt.Component c ) → void
Parameters
c - a Component
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 - an URL
userInfo - a String
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
writeKeysFile( boolean toFile ) → void