Class UnsignedAppletActionStorageImpl
- All Implemented Interfaces:
UnsignedAppletActionStorage
- Direct Known Subclasses:
UnsignedAppletActionStorageExtendedImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidvoidadd(UnsignedAppletActionEntry item) Will add new record.private voidbackupOldFile(int version, File backingFile) private booleancompareArchives(List<String> archives, List<String> saved) getMatchingItem(String documentBase, String codeBase, List<String> archives, Class<? extends RememberableDialog> id) This methods iterates through records in net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustUserSettingsPath or net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustGlobalSettingsPath, and is matching regexes saved here against params.getMatchingItemByBases(String documentBase, String codeBase, Class<? extends RememberableDialog> id) ShortcutgetMatchingItem(documentBase, codeBase, null, null)getMatchingItemByCodeBase(String codeBase, Class<? extends RememberableDialog> id) ShortcutgetMatchingItem(null, codeBase, null, null)getMatchingItemByDocumentBase(String documentBase, Class<? extends RememberableDialog> id) ShortcutgetMatchingItem(documentBase, null, null, null)getMatchingItems(String documentBase, String codeBase, List<String> archives) private booleanisMatching(UnsignedAppletActionEntry unsignedAppletActionEntry, String documentBase, String codeBase, List<String> archives) protected voidReads contents from file.protected voidtoString()voidWill replace (current impl is matching by object's hashcode.voidvoidWrites stored contents to file.voidWrite contents to the file, first acquiring a lock.Methods inherited from class LockingReaderWriter
doLocked, getBackingFile, isReadOnly, lock, unlockMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface UnsignedAppletActionStorage
lock, unlock
-
Field Details
-
LOG
-
items
-
readVersion
-
versionPrefix
- See Also:
-
BACKUP_SUFFIX
- See Also:
-
currentVersion
public static final int currentVersion- See Also:
-
lineCounter
private int lineCounter -
loadingDisabled
private boolean loadingDisabled
-
-
Constructor Details
-
UnsignedAppletActionStorageImpl
-
-
Method Details
-
writeContents
Description copied from class:LockingReaderWriterWrites stored contents to file. Assumes lock is held.- Overrides:
writeContentsin classLockingReaderWriter- Throws:
IOException
-
writeContentsLocked
Description copied from class:LockingReaderWriterWrite contents to the file, first acquiring a lock.- Overrides:
writeContentsLockedin classLockingReaderWriter- Throws:
IOException
-
readContents
Description copied from class:LockingReaderWriterReads contents from file. Assumes lock is held.- Overrides:
readContentsin classLockingReaderWriter- Throws:
IOException
-
readLine
- Specified by:
readLinein classLockingReaderWriter
-
writeContent
- Specified by:
writeContentin classLockingReaderWriter- Throws:
IOException
-
add
Description copied from interface:UnsignedAppletActionStorageWill add new record. Note that regexes are stored for bases matching.eg UnsignedAppletActionEntry which will deny some applet no matter of page will be
newUnsignedAppletActionEntry(ExecuteUnsignedApplet#NEVER, newDate(), null, null, someMain, someArchives)eg
UnsignedAppletActionEntrywhich will allow all applets on page with same codebase will benewUnsignedAppletActionEntry(ExecuteUnsignedApplet#NEVER, newDate(), ".*", ".*", null, null);- Specified by:
addin interfaceUnsignedAppletActionStorage- Parameters:
item-
-
update
Description copied from interface:UnsignedAppletActionStorageWill replace (current impl is matching by object's hashcode. This is not reloading the list (but still saving after), soStorageIoExceptioncan be thrown if it was not loaded before.Imho this should be used only to actualise timestamps or change
UnsignedAppletActionEntry- Specified by:
updatein interfaceUnsignedAppletActionStorage- Parameters:
item-
-
getMatchingItem
public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List<String> archives, Class<? extends RememberableDialog> id) Description copied from interface:UnsignedAppletActionStorageThis methods iterates through records in net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustUserSettingsPath or net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustGlobalSettingsPath, and is matching regexes saved here against params. So parameters here are NOT regexes, but are matched against saved regexes.nullor empty values are dangerously ignored, user, be aware of it. eg: match onlycodeBasewill benullsomeCodeBasenullnullmatch onlydocumentBasewill be someDocBasenullnullnullmatch only applet not regarding code or document base will benullnullmainClass archives.- Specified by:
getMatchingItemin interfaceUnsignedAppletActionStorage- Parameters:
documentBase-codeBase-archives-id- of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search- Returns:
- a matching unsigned applet action entry
-
getMatchingItems
-
isMatching
private boolean isMatching(UnsignedAppletActionEntry unsignedAppletActionEntry, String documentBase, String codeBase, List<String> archives) -
toString
-
compareArchives
-
getMatchingItemByDocumentBase
public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase, Class<? extends RememberableDialog> id) Description copied from interface:UnsignedAppletActionStorageShortcutgetMatchingItem(documentBase, null, null, null)- Specified by:
getMatchingItemByDocumentBasein interfaceUnsignedAppletActionStorage- Parameters:
documentBase-id- of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search- Returns:
- a matching unsigned applet action entry
-
getMatchingItemByCodeBase
public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase, Class<? extends RememberableDialog> id) Description copied from interface:UnsignedAppletActionStorageShortcutgetMatchingItem(null, codeBase, null, null)- Specified by:
getMatchingItemByCodeBasein interfaceUnsignedAppletActionStorage- Parameters:
codeBase-id- of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search- Returns:
- a matching unsigned applet action entry
-
getMatchingItemByBases
public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase, Class<? extends RememberableDialog> id) Description copied from interface:UnsignedAppletActionStorageShortcutgetMatchingItem(documentBase, codeBase, null, null)- Specified by:
getMatchingItemByBasesin interfaceUnsignedAppletActionStorage- Parameters:
documentBase-codeBase-id- of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search- Returns:
- a matching unsigned applet action entry
-
actOnVersionLoad
private void actOnVersionLoad() -
actOnNoVersionLoad
private void actOnNoVersionLoad() -
backupOldFile
-