TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.key
Class PromptingKeyManager<K extends SafeKey<K>>

java.lang.Object
  extended by de.schlichtherle.truezip.key.SafeKeyManager<K,PromptingKeyProvider<K>>
      extended by de.schlichtherle.truezip.key.PromptingKeyManager<K>
Type Parameters:
K - The type of the keys.
All Implemented Interfaces:
KeyManager<K>

@ThreadSafe
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public final class PromptingKeyManager<K extends SafeKey<K>>
extends SafeKeyManager<K,PromptingKeyProvider<K>>

A key manager which prompts the user for a key if required.

Author:
Christian Schlichtherle
See Also:
PromptingKeyProvider

Field Summary
private  PromptingKeyProvider.View<K> view
           
 
Constructor Summary
PromptingKeyManager(PromptingKeyProvider.View<K> view)
          Constructs a new prompting key manager.
 
Method Summary
 PromptingKeyProvider<K> getKeyProvider(URI resource)
          Returns the key provider for the given protected resource.
 PromptingKeyProvider<K> moveKeyProvider(URI oldResource, URI newResource)
          Moves the key provider from the URI oldResource to newResource.
 PromptingKeyProvider<K> removeKeyProvider(URI resource)
          Removes the key provider for the given protected resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

private final PromptingKeyProvider.View<K extends SafeKey<K>> view
Constructor Detail

PromptingKeyManager

public PromptingKeyManager(PromptingKeyProvider.View<K> view)
Constructs a new prompting key manager.

Parameters:
view - the view instance for prompting for keys.
Method Detail

getKeyProvider

public PromptingKeyProvider<K> getKeyProvider(URI resource)
Description copied from interface: KeyManager
Returns the key provider for the given protected resource. If no key provider is mapped, a new key provider is created and returned.

Specified by:
getKeyProvider in interface KeyManager<K extends SafeKey<K>>
Overrides:
getKeyProvider in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
Parameters:
resource - the URI of the protected resource.
Returns:
The key provider mapped for the protected resource.

moveKeyProvider

public PromptingKeyProvider<K> moveKeyProvider(URI oldResource,
                                               URI newResource)
Description copied from interface: KeyManager
Moves the key provider from the URI oldResource to newResource.

Specified by:
moveKeyProvider in interface KeyManager<K extends SafeKey<K>>
Overrides:
moveKeyProvider in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
Parameters:
oldResource - the old URI of the protected resource.
newResource - the new URI of the protected resource.
Returns:
The key provider which was previously mapped for the protected resource newResource.

removeKeyProvider

public PromptingKeyProvider<K> removeKeyProvider(URI resource)
Description copied from interface: KeyManager
Removes the key provider for the given protected resource.

Specified by:
removeKeyProvider in interface KeyManager<K extends SafeKey<K>>
Overrides:
removeKeyProvider in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
Parameters:
resource - the URI of the protected resource.
Returns:
The key provider which was previously mapped for the protected resource.

TrueZIP Driver ZIP.RAES (TZP) 7.1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.