}
  protected PermissionCollection getPermissions(CodeSource source)  {    // XXX - This implementation does exactly as the Javadoc describes.    // But maybe we should/could use URLConnection.getPermissions()?    // First get the permissions that would normally be granted    PermissionCollection permissions = super.getPermissions(source);            // Now add the any extra permissions depending on the URL location    URL url = source.getLocation();    String protocol = url.getProtocol();    if (protocol.equals("file"))      {	String file = url.getFile();	// If the file end in / it must be an directory	if (file.endsWith("/") || file.endsWith(File.separator))	  {	    // Grant permission to read everything in that directory and	    // all subdirectories	    permissions.add(new FilePermission(file + "-", "read"));	  }	else	  {	    // It is a 'normal' file	    // Grant permission to access that file	    permissions.add(new FilePermission(file, "read"));	  }      }    else      {	// Grant permission to connect to and accept connections from host	String host = url.getHost();	if (host != null)	  permissions.add(new SocketPermission(host, "connect,accept"));      }    return permissions;  }