Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.osgi.internal.baseadaptor;
public class BasePermissionStorage implements PermissionStorage {
	private HashMap locations = new HashMap();
	private String[] defaultInfos;
	private String[] condPermInfos;
	private boolean dirty;
		this. = storage;
	}
	public String[] getLocations() throws IOException {
		synchronized () {
			String[] result = new String[.size()];
			int i = 0;
			for (Iterator iLocs = .keySet().iterator(); iLocs.hasNext(); i++)
				result[i] = (StringiLocs.next();
			return result;
		}
	}
	public String[] getPermissionData(String locationthrows IOException {
		if (location == null)
			return ;
		synchronized () {
			if (.size() == 0)
				return null;
			return (String[]) .get(location);
		}
	}
	public void setPermissionData(String locationString[] datathrows IOException {
		if (location == null) {
			 = data;
			return;
		}
		synchronized () {
			if (data == null)
				.remove(location);
			else
				.put(locationdata);
		}
		setDirty(true);
	}
	public void saveConditionalPermissionInfos(String[] infosthrows IOException {
		 = infos;
		setDirty(true);
	}
		return ;
	}
	public boolean isDirty() {
		return ;
	}
	public void setDirty(boolean dirty) {
		this. = dirty;
	}
New to GrepCode? Check out our FAQ X