com.threerings.jpkg
Class PermissionsMap

java.lang.Object
  extended by com.threerings.jpkg.PermissionsMap

public class PermissionsMap
extends Object

Maps arbitrary permissions onto associated paths.


Field Summary
(package private)  Map<String,PathPermissions> _permissions
          Mapping of path to the permissions for that path.
 
Constructor Summary
PermissionsMap()
           
 
Method Summary
 void addPathPermissions(String path, PathPermissions permissions)
          Add a PathPermissions object associated with a given path.
 PathPermissions getPathPermissions(String path)
          Return a PathPermissions object for the supplied path if it exists, null otherwise.
 Set<Map.Entry<String,PathPermissions>> getPermissions()
          Return a Set of Map.Entry objects holding paths and the PathPermissions object associated with that path.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_permissions

Map<String,PathPermissions> _permissions
Mapping of path to the permissions for that path.

Constructor Detail

PermissionsMap

public PermissionsMap()
Method Detail

addPathPermissions

public void addPathPermissions(String path,
                               PathPermissions permissions)
Add a PathPermissions object associated with a given path. This method guarantees that there will only be one PathPermissions object applied to a given path. Calling this method more than once for the same path will replace any permissions already set for that path. The path will be normalized.

Throws:
InvalidPathException - If the supplied path is invalid.

getPermissions

public Set<Map.Entry<String,PathPermissions>> getPermissions()
Return a Set of Map.Entry objects holding paths and the PathPermissions object associated with that path.


getPathPermissions

public PathPermissions getPathPermissions(String path)
Return a PathPermissions object for the supplied path if it exists, null otherwise.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.