org.eclipse.osgi.framework.internal.core
Class SecurePermissionStorage

java.lang.Object
  extended by org.eclipse.osgi.framework.internal.core.SecurePermissionStorage
All Implemented Interfaces:
java.security.PrivilegedExceptionAction, PermissionStorage

public class SecurePermissionStorage
extends java.lang.Object
implements PermissionStorage, java.security.PrivilegedExceptionAction

PermissionStorage privileged action class.


Constructor Summary
SecurePermissionStorage(PermissionStorage storage)
           
 
Method Summary
 java.lang.String[] getConditionalPermissionInfos()
          Returns the persistent array of encoded ConditionalPermissionInfo strings
 java.lang.String[] getLocations()
          Returns the locations that have permission data assigned to them, that is, locations for which permission data exists in persistent storage.
 java.lang.String[] getPermissionData(java.lang.String location)
          Gets the permission data assigned to the specified location.
 java.lang.Object run()
           
 void saveConditionalPermissionInfos(java.lang.String[] infos)
          Persists the array of encoded ConditionalPermissionInfo strings
 void setPermissionData(java.lang.String location, java.lang.String[] data)
          Assigns the specified permission data to the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurePermissionStorage

public SecurePermissionStorage(PermissionStorage storage)
Method Detail

run

public java.lang.Object run()
                     throws java.io.IOException
Specified by:
run in interface java.security.PrivilegedExceptionAction
Throws:
java.io.IOException

getPermissionData

public java.lang.String[] getPermissionData(java.lang.String location)
                                     throws java.io.IOException
Description copied from interface: PermissionStorage
Gets the permission data assigned to the specified location.

Specified by:
getPermissionData in interface PermissionStorage
Parameters:
location - The location whose permission data is to be returned. The location can be null for the default permission data.
Returns:
The permission data assigned to the specified location, or null if that location has not been assigned any permission data.
Throws:
java.io.IOException - If a failure occurs accessing persistent storage.

getLocations

public java.lang.String[] getLocations()
                                throws java.io.IOException
Description copied from interface: PermissionStorage
Returns the locations that have permission data assigned to them, that is, locations for which permission data exists in persistent storage.

Specified by:
getLocations in interface PermissionStorage
Returns:
The locations that have permission data in persistent storage, or null if there is no permission data in persistent storage.
Throws:
java.io.IOException - If a failure occurs accessing persistent storage.

setPermissionData

public void setPermissionData(java.lang.String location,
                              java.lang.String[] data)
                       throws java.io.IOException
Description copied from interface: PermissionStorage
Assigns the specified permission data to the specified location.

Specified by:
setPermissionData in interface PermissionStorage
Parameters:
location - The location that will be assigned the permissions. The location can be null for the default permission data.
data - The permission data to be assigned, or null if the specified location is to be removed from persistent storaqe.
Throws:
java.io.IOException - If a failure occurs modifying persistent storage.

saveConditionalPermissionInfos

public void saveConditionalPermissionInfos(java.lang.String[] infos)
                                    throws java.io.IOException
Description copied from interface: PermissionStorage
Persists the array of encoded ConditionalPermissionInfo strings

Specified by:
saveConditionalPermissionInfos in interface PermissionStorage
Parameters:
infos - an array of encoded ConditionalPermissionInfo strings
Throws:
java.io.IOException - If a failure occurs modifying persistent storage.

getConditionalPermissionInfos

public java.lang.String[] getConditionalPermissionInfos()
                                                 throws java.io.IOException
Description copied from interface: PermissionStorage
Returns the persistent array of encoded ConditionalPermissionInfo strings

Specified by:
getConditionalPermissionInfos in interface PermissionStorage
Returns:
an array of encoded ConditionalPermissionInfo strings or null if none exist in persistent storage.
Throws:
java.io.IOException - If a failure occurs accessing persistent storage.