Permission permission = null;
if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
if (!path.endsWith("/")) {
path = path + "/";
}
permission = new JndiPermission(path + "*");
addPermission(permission);
} else {
if (!path.endsWith(File.separator)) {
permission = new FilePermission(path, "read");
addPermission(permission);