org.sakaiproject.component.legacy.content
Class BaseExtensionResourceFilter

java.lang.Object
  extended byorg.sakaiproject.component.legacy.content.BaseExtensionResourceFilter
All Implemented Interfaces:
ContentResourceFilter

public class BaseExtensionResourceFilter
extends Object
implements ContentResourceFilter

This class implements the typical mime type and extension filter. This will be a registered bean with the component manager that application components can extend to control the list of mime types and the list of acceptable extentions.


Constructor Summary
BaseExtensionResourceFilter()
           
 
Method Summary
 boolean allowSelect(ContentResource resource)
          Implement this method to control which resources are allowed to be selected.
 boolean allowView(ContentResource contentResource)
          Implement this method to control which resources are viewable.
 List getAcceptedExtensions()
           
 List getMimeTypes()
           
 boolean isViewAll()
           
 void setAcceptedExtensions(List acceptedExtensions)
          List of accepted file name extensions.
 void setMimeTypes(List mimeTypes)
          The list of mime types to allow.
 void setViewAll(boolean viewAll)
          boolean to indicate if all resources should be viewable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseExtensionResourceFilter

public BaseExtensionResourceFilter()
Method Detail

allowSelect

public boolean allowSelect(ContentResource resource)
Description copied from interface: ContentResourceFilter
Implement this method to control which resources are allowed to be selected. Implementation should inspect the resource and return true if the resource should be selectable and false if not.

Specified by:
allowSelect in interface ContentResourceFilter
Parameters:
resource - resource to test
Returns:
true if resource should be selectable, false if not

allowView

public boolean allowView(ContentResource contentResource)
Description copied from interface: ContentResourceFilter
Implement this method to control which resources are viewable. Implementation should inspect the resource and return true if the resource should be presented in the list and false if not.

Specified by:
allowView in interface ContentResourceFilter
Parameters:
contentResource - resource to test
Returns:
true if resource should be viewable, false if not

getMimeTypes

public List getMimeTypes()

setMimeTypes

public void setMimeTypes(List mimeTypes)
The list of mime types to allow. The passed in content resource will be tested to see if the resouce's primary mime type is included in the list (ie "text" for "text/xml") and then the whole mime type will be tested for existence in the list.

Parameters:
mimeTypes -

isViewAll

public boolean isViewAll()

setViewAll

public void setViewAll(boolean viewAll)
boolean to indicate if all resources should be viewable. If this is false, then the viewable resources will be based on the mime types and extention set in the other properties.

Parameters:
viewAll -

getAcceptedExtensions

public List getAcceptedExtensions()

setAcceptedExtensions

public void setAcceptedExtensions(List acceptedExtensions)
List of accepted file name extensions. If this list is null, all extensions are acceptable.

Parameters:
acceptedExtensions -