Package org.eclipse.osgi.framework.adaptor

Examples of org.eclipse.osgi.framework.adaptor.PermissionStorage


  public PermissionInfo[] getPermissions(String location) {
    if (location == null) {
      throw new NullPointerException();
    }

    PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);

    try {
      String[] data = storage.getPermissionData(location);

      if (Debug.DEBUG && Debug.DEBUG_SECURITY) {
        Debug.println("Getting permissions for location: " + location); //$NON-NLS-1$
        if (data == null) {
          Debug.println("  <none>"); //$NON-NLS-1$
View Full Code Here


      sm.checkPermission(new AllPermission());
    if (location == null) {
      throw new NullPointerException();
    }

    PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);

    try {
      String[] data = makePermissionData(permissions);

      if (Debug.DEBUG && Debug.DEBUG_SECURITY) {
        Debug.println("Setting permissions for location: " + location); //$NON-NLS-1$
        if (data == null) {
          Debug.println("  <none>"); //$NON-NLS-1$
        } else {
          for (int i = 0; i < data.length; i++) {
            Debug.println("  " + data[i]); //$NON-NLS-1$
          }
        }
      }

      storage.setPermissionData(location, data);
    } catch (IOException e) {
      framework.publishFrameworkEvent(FrameworkEvent.ERROR, framework.systemBundle, e);

      return;
    }
View Full Code Here

   *
   * @return The locations of bundles that have been assigned any
   * permissions, or <tt>null</tt> if the permission table is empty.
   */
  public String[] getLocations() {
    PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);

    try {
      String[] locations = storage.getLocations();

      return locations;
    } catch (IOException e) {
      framework.publishFrameworkEvent(FrameworkEvent.ERROR, framework.systemBundle, e);

View Full Code Here

   *
   * @return The default permissions, or <tt>null</tt> if default
   * permissions have not been defined.
   */
  public PermissionInfo[] getDefaultPermissions() {
    PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);

    try {
      String[] data = storage.getPermissionData(null);

      if (Debug.DEBUG && Debug.DEBUG_SECURITY) {
        Debug.println("Getting default permissions"); //$NON-NLS-1$
        if (data == null) {
          Debug.println("  <none>"); //$NON-NLS-1$
View Full Code Here

   */
  public void setDefaultPermissions(PermissionInfo[] permissions) {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
      sm.checkPermission(new AllPermission());
    PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);

    try {
      String[] data = makePermissionData(permissions);

      if (Debug.DEBUG && Debug.DEBUG_SECURITY) {
        Debug.println("Setting default permissions"); //$NON-NLS-1$
        if (data == null) {
          Debug.println("  <none>"); //$NON-NLS-1$
        } else {
          for (int i = 0; i < data.length; i++) {
            Debug.println("  " + data[i]); //$NON-NLS-1$
          }
        }
      }

      storage.setPermissionData(null, data);
    } catch (IOException e) {
      framework.publishFrameworkEvent(FrameworkEvent.ERROR, framework.systemBundle, e);

      return;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.adaptor.PermissionStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.