/**
 * Copyright  2001 The JA-SIG Collaborative.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the JA-SIG Collaborative
 *    (http://www.jasig.org/)."
 *
 * THIS SOFTWARE IS PROVIDED BY THE JA-SIG COLLABORATIVE "AS IS" AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE JA-SIG COLLABORATIVE OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 * formatted with JxBeauty (c) johann.langhofer@nextra.at
 */


package  org.jasig.portal.security.provider;

import java.io.IOException;
import java.util.Properties;
import java.util.Vector;

import org.jasig.portal.security.IAuthorization;
import org.jasig.portal.security.IPerson;
import org.jasig.portal.security.PortalSecurityException;
import org.jasig.portal.services.LogService;
import org.jasig.portal.utils.SmartCache;


/**
 * @author Bernie Durfee, bdurfee@interactivebusiness.com
 * @version $Revision$
 * @deprecated As of uPortal 2.0, replaced by {@link AuthorizationImpl}
 */
public class ReferenceAuthorization implements IAuthorization {
  // Clear the caches every 10 seconds
  protected static SmartCache userRolesCache = new SmartCache(300);
  protected static SmartCache chanRolesCache = new SmartCache(300);
  protected static String s_channelPublisherRole = null;
  static {
    try {
      // Find our properties file and open it
      java.io.InputStream stream = ReferenceAuthorization.class.getResourceAsStream("/properties/security.properties");
      Properties securityProps = new Properties();
      try {
        securityProps.load(stream);
		  stream.close();
        s_channelPublisherRole = securityProps.getProperty("channelPublisherRole");
      } catch (IOException e) {
        LogService.log(LogService.ERROR, new PortalSecurityException(e.getMessage()));
      }
    } catch (Exception e) {
      LogService.log(LogService.ERROR, e);
    }
  }


  // For the subscribe mechanism to use
  public Vector getAuthorizedChannels (IPerson person) {
    if (person == null || person.getID() == -1) {
      // Possibly throw security exception
      return  (null);
    }
    return  (new Vector());
  }
}




@@ -1725,24 +1725,52 @@
 OException;%0A
+import java.io.InputStream;%0A
 import java.
@@ -2518,16 +2518,46 @@
 tatic %7B%0A
+  %09InputStream stream = null;%0A
     try 
@@ -2614,28 +2614,8 @@
     
-java.io.InputStream 
 stre
@@ -2759,22 +2759,8 @@
 ();%0A
-      try %7B%0A  
     
@@ -2793,30 +2793,8 @@
 m);%0A
-%09%09  stream.close();%0A  
     
@@ -2997,22 +2997,16 @@
 %0A      %7D
-%0A    %7D
  catch (
@@ -3068,16 +3068,237 @@
 );%0A    %7D
+ finally %7B%0A%09%09%09try %7B%0A%09%09%09%09if (stream != null)%0A%09%09%09%09%09stream.close();%0A%09%09%09%7D catch (IOException exception) %7B%0A%09%09%09%09LogService.log(LogService.ERROR,%22ReferenceAuthorization:static::unable to close InputStream %22+ exception);%0A%09%09%09%7D%0A%09%09%7D
 %0A  %7D%0A%0A%0A 

Fix for Bug#: 1568 For details please check following link http://mis105.mis.udel.edu/bugzilla/show_bug.cgi?id=1568