Class ComponentFileFilterParameter
- java.lang.Object
-
- org.silverpeas.core.admin.component.model.ComponentFileFilterParameter
-
public class ComponentFileFilterParameter extends Object
This class handles component file filters (authorized or forbidden files). User: Yohann Chastagnier Date: 17/12/12
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ComponentFileFilterParameter
from(SilverpeasComponentInstance component)
Getting component file filter from component instance.SilverpeasComponentInstance
getComponent()
Gets the component instance.String
getFileFilters()
Gets the current file filter.boolean
isAuthorization()
Indicates if getMimeTypes returns authorized or forbidden files.boolean
isFileAuthorized(File file)
Checks if the given file is authorized.boolean
isFileFilterGloballySet()
Indicates if the file filter is set globally.boolean
isMimeTypeAuthorized(String mimeType)
Checks if the given mime type is authorized.void
verifyFileAuthorized(File file)
Throwing the component file filter exception (RuntimeException) if file is forbidden.
-
-
-
Method Detail
-
from
public static ComponentFileFilterParameter from(SilverpeasComponentInstance component)
Getting component file filter from component instance.- Parameters:
component
-- Returns:
-
getComponent
public SilverpeasComponentInstance getComponent()
Gets the component instance.- Returns:
-
isAuthorization
public boolean isAuthorization()
Indicates if getMimeTypes returns authorized or forbidden files.- Returns:
-
getFileFilters
public String getFileFilters()
Gets the current file filter.- Returns:
-
isFileFilterGloballySet
public boolean isFileFilterGloballySet()
Indicates if the file filter is set globally.- Returns:
-
isFileAuthorized
public boolean isFileAuthorized(File file)
Checks if the given file is authorized. If parameter is null, it is considered as forbidden.- Parameters:
file
-- Returns:
-
verifyFileAuthorized
public void verifyFileAuthorized(File file)
Throwing the component file filter exception (RuntimeException) if file is forbidden.- Parameters:
file
-
-
isMimeTypeAuthorized
public boolean isMimeTypeAuthorized(String mimeType)
Checks if the given mime type is authorized. If parameter is null, it is considered as forbidden.- Parameters:
mimeType
-- Returns:
-
-