2015-06-24 15:16:13 +02:00
|
|
|
/**
|
2016-01-15 11:13:48 +01:00
|
|
|
*
|
2015-06-24 15:16:13 +02:00
|
|
|
*/
|
|
|
|
package org.gcube.portlets.widgets.wsexplorer.server;
|
|
|
|
|
|
|
|
import java.util.LinkedList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
|
|
import org.gcube.common.homelibary.model.items.type.WorkspaceItemType;
|
|
|
|
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
2015-06-25 12:33:18 +02:00
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
2015-06-24 15:16:13 +02:00
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
2015-06-25 12:33:18 +02:00
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
2015-06-24 15:16:13 +02:00
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
|
|
|
|
import org.gcube.portlets.widgets.wsexplorer.client.Util;
|
2015-06-24 15:18:42 +02:00
|
|
|
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
2015-06-24 15:16:13 +02:00
|
|
|
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
|
|
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
|
|
|
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
2015-06-30 18:10:45 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2015-06-24 15:16:13 +02:00
|
|
|
|
|
|
|
/**
|
2015-06-25 12:33:18 +02:00
|
|
|
* The Class ItemBuilder.
|
|
|
|
*
|
2015-06-24 15:16:13 +02:00
|
|
|
* @author Federico De Faveri defaveri@isti.cnr.it
|
|
|
|
* Modified by Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
|
|
*/
|
|
|
|
public class ItemBuilder {
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-30 18:10:45 +02:00
|
|
|
public static final Logger _log = LoggerFactory.getLogger(ItemBuilder.class);
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Purge empty folders.
|
|
|
|
*
|
|
|
|
* @param item the item
|
|
|
|
* @return the item
|
|
|
|
*/
|
2015-06-24 15:16:13 +02:00
|
|
|
public static Item purgeEmptyFolders(Item item)
|
|
|
|
{
|
2015-06-25 12:33:18 +02:00
|
|
|
//for (Item child:item.getChildren()) purgeEmptyFolders(child); ONLY FIRST LEVEL
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
List<Item> toRemoveList = new LinkedList<Item>();
|
|
|
|
for (Item child:item.getChildren()) {
|
|
|
|
boolean toRemove = isAnEmptyFolder(child);
|
2016-01-15 11:13:48 +01:00
|
|
|
if (toRemove) {
|
|
|
|
toRemoveList.add(child);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Item child:toRemoveList) {
|
|
|
|
item.removeChild(child);
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
return item;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Checks if is an empty folder.
|
|
|
|
*
|
|
|
|
* @param item the item
|
|
|
|
* @return true, if is an empty folder
|
|
|
|
*/
|
2015-06-24 15:16:13 +02:00
|
|
|
protected static boolean isAnEmptyFolder(Item item)
|
|
|
|
{
|
|
|
|
return Util.isFolder(item.getType()) && item.getChildren().size() == 0;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2016-02-03 17:08:33 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
/**
|
2015-07-29 16:23:29 +02:00
|
|
|
* Gets the item.
|
2015-06-25 12:33:18 +02:00
|
|
|
*
|
|
|
|
* @param parent the parent
|
|
|
|
* @param workspaceItem the workspace item
|
2016-02-03 17:08:33 +01:00
|
|
|
* @param workspaceItemPath the workspace item path
|
2015-06-25 12:33:18 +02:00
|
|
|
* @param showableTypes the showable types
|
|
|
|
* @param filterCriteria the filter criteria
|
|
|
|
* @param loadChildren the load children
|
|
|
|
* @return the item
|
|
|
|
* @throws InternalErrorException the internal error exception
|
2015-06-24 15:16:13 +02:00
|
|
|
*/
|
2016-02-03 17:08:33 +01:00
|
|
|
public static Item getItem(Item parent, WorkspaceItem workspaceItem, String workspaceItemPath, List<ItemType> showableTypes, FilterCriteria filterCriteria, boolean loadChildren) throws InternalErrorException
|
2015-06-24 15:16:13 +02:00
|
|
|
{
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
ItemType type = getItemType(workspaceItem);
|
2016-01-15 11:13:48 +01:00
|
|
|
|
|
|
|
if (!showableTypes.contains(type)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
if (!filterItem(type, workspaceItem, filterCriteria)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-07-13 17:15:21 +02:00
|
|
|
// //TODO ADD CONTROL ON THE PATH WHEN WILL BE MORE FAST
|
|
|
|
// if (itemName.equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL))
|
|
|
|
// itemName = WorkspaceExplorerConstants.VRE_FOLDERS_LABEL;
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-10-05 16:55:30 +02:00
|
|
|
boolean isFolder = type.equals(ItemType.FOLDER)?true:false;
|
|
|
|
boolean isSharedFolder = workspaceItem.getType().equals(WorkspaceItemType.SHARED_FOLDER)?true:false;
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-10-05 16:55:30 +02:00
|
|
|
String itemName = workspaceItem.getName();
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-10-05 16:55:30 +02:00
|
|
|
if(isSharedFolder){
|
|
|
|
_log.debug("Is shared folder");
|
|
|
|
WorkspaceSharedFolder shared = (WorkspaceSharedFolder) workspaceItem;
|
|
|
|
itemName = shared.isVreFolder()?shared.getDisplayName():workspaceItem.getName();
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2016-02-09 11:03:01 +01:00
|
|
|
// _log.debug("Building Item for: "+itemName);
|
2016-02-03 12:20:42 +01:00
|
|
|
Item item = null;
|
|
|
|
try{
|
|
|
|
//THIS CALL IS VERY SLOW!!
|
|
|
|
// String storageID = null;
|
|
|
|
// if(workspaceItem instanceof FolderItem){
|
|
|
|
// storageID = workspaceItem.getStorageID();
|
|
|
|
// }
|
2016-02-03 17:08:33 +01:00
|
|
|
item = new Item(parent, workspaceItem.getId(), itemName, type, workspaceItemPath, UserUtil.getUserFullName(workspaceItem.getOwner().getPortalLogin()), isFolder, false);
|
2016-02-03 12:20:42 +01:00
|
|
|
item.setSharedFolder(isSharedFolder);
|
|
|
|
}catch(Exception e){
|
|
|
|
_log.error("Error on getting item: "+itemName+" with id: "+workspaceItem.getId()+", from HL, so skipping item");
|
|
|
|
return null;
|
2016-01-15 11:13:48 +01:00
|
|
|
}
|
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
if(loadChildren){
|
2016-02-03 17:08:33 +01:00
|
|
|
//TODO A PATCH TO AVOID A SLOW GETPATH
|
|
|
|
workspaceItemPath = workspaceItem.getPath();
|
2015-06-25 12:33:18 +02:00
|
|
|
for (WorkspaceItem child: workspaceItem.getChildren()){
|
2016-02-09 11:31:14 +01:00
|
|
|
String itemPath = workspaceItemPath;
|
2016-02-03 17:08:33 +01:00
|
|
|
if(child.isFolder())
|
2016-02-09 11:31:14 +01:00
|
|
|
itemPath+="/"+child.getName();
|
2016-02-03 17:08:33 +01:00
|
|
|
|
|
|
|
// _log.trace("\nConverting child item: "+child.getName());
|
2016-02-09 11:31:14 +01:00
|
|
|
Item itemChild = getItem(item, child, itemPath, showableTypes, filterCriteria, false);
|
2016-02-09 11:03:01 +01:00
|
|
|
// _log.trace("Item: "+child.getName() +" converted!!!");
|
2015-06-25 12:33:18 +02:00
|
|
|
if (itemChild!=null){
|
|
|
|
item.addChild(itemChild);
|
|
|
|
}
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
return item;
|
|
|
|
}
|
2015-06-25 12:33:18 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the item type.
|
|
|
|
*
|
|
|
|
* @param item the item
|
|
|
|
* @return the item type
|
|
|
|
* @throws InternalErrorException the internal error exception
|
|
|
|
*/
|
2015-06-24 15:16:13 +02:00
|
|
|
protected static ItemType getItemType(WorkspaceItem item) throws InternalErrorException
|
|
|
|
{
|
|
|
|
switch(item.getType())
|
|
|
|
{
|
|
|
|
case SHARED_FOLDER:
|
|
|
|
case FOLDER:{
|
2015-07-13 17:15:21 +02:00
|
|
|
// if (item.isRoot()) return ItemType.ROOT;
|
2015-06-24 15:16:13 +02:00
|
|
|
return ItemType.FOLDER;
|
|
|
|
}
|
|
|
|
case FOLDER_ITEM: return getFolderItemType((FolderItem) item);
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
default:
|
|
|
|
return null;
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Gets the folder item type.
|
|
|
|
*
|
|
|
|
* @param item the item
|
|
|
|
* @return the folder item type
|
|
|
|
*/
|
2015-06-30 14:52:40 +02:00
|
|
|
protected static ItemType getFolderItemType(FolderItem item){
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-10 12:31:47 +02:00
|
|
|
try{
|
|
|
|
return ItemType.valueOf(item.getFolderItemType().toString());
|
|
|
|
}catch (Exception e) {
|
|
|
|
_log.error("Item Type non found: ",e);
|
|
|
|
return ItemType.UNKNOWN_TYPE;
|
|
|
|
}
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Filter item.
|
|
|
|
*
|
|
|
|
* @param type the type
|
|
|
|
* @param item the item
|
|
|
|
* @param filterCriteria the filter criteria
|
|
|
|
* @return true, if successful
|
|
|
|
* @throws InternalErrorException the internal error exception
|
|
|
|
*/
|
2015-06-30 14:52:40 +02:00
|
|
|
protected static boolean filterItem(ItemType type, WorkspaceItem item, FilterCriteria filterCriteria) throws InternalErrorException {
|
2016-01-15 11:13:48 +01:00
|
|
|
if(filterCriteria==null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
boolean mimeTypeCheck = checkAllowedMimeTypes(type, item, filterCriteria.getAllowedMimeTypes());
|
2016-01-15 11:13:48 +01:00
|
|
|
if (!mimeTypeCheck) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
boolean fileExtensionCheck = checkAllowedFileExtension(type, item, filterCriteria.getAllowedFileExtensions());
|
2016-01-15 11:13:48 +01:00
|
|
|
if(!fileExtensionCheck) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean propertiesCheck = checkProperties(item, filterCriteria.getRequiredProperties());
|
2015-06-24 15:16:13 +02:00
|
|
|
return propertiesCheck;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Check allowed mime types.
|
|
|
|
*
|
|
|
|
* @param type the type
|
|
|
|
* @param item the item
|
|
|
|
* @param allowedMimeTypes the allowed mime types
|
|
|
|
* @return true, if successful
|
|
|
|
*/
|
2015-06-30 14:52:40 +02:00
|
|
|
protected static boolean checkAllowedMimeTypes(ItemType type, WorkspaceItem item, List<String> allowedMimeTypes){
|
2016-01-15 11:13:48 +01:00
|
|
|
if (allowedMimeTypes==null || allowedMimeTypes.size()==0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
if (type == ItemType.EXTERNAL_FILE || type == ItemType.EXTERNAL_IMAGE || type == ItemType.EXTERNAL_PDF_FILE) {
|
|
|
|
ExternalFile externalFile = (ExternalFile)item;
|
|
|
|
String mimeType = externalFile.getMimeType();
|
|
|
|
return allowedMimeTypes.contains(mimeType);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check allowed file extension.
|
|
|
|
*
|
|
|
|
* @param type the type
|
|
|
|
* @param item the item
|
|
|
|
* @param allowedFileExtension the allowed mime types
|
|
|
|
* @return true, if successful
|
|
|
|
*/
|
|
|
|
protected static boolean checkAllowedFileExtension(ItemType type, WorkspaceItem item, List<String> allowedFileExtension){
|
2016-01-15 11:13:48 +01:00
|
|
|
if (allowedFileExtension==null || allowedFileExtension.size()==0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
try {
|
|
|
|
if (type != ItemType.FOLDER) {
|
|
|
|
String name = item.getName();
|
|
|
|
return checkFileExtension(name, allowedFileExtension);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
} catch (InternalErrorException e) {
|
|
|
|
_log.error("checkAllowedFileExtension, InternalErrorException: ",e);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
/**
|
|
|
|
* Check file extension.
|
|
|
|
*
|
|
|
|
* @param fileName the file name
|
|
|
|
* @param allowedFileExtension the allowed file extension
|
|
|
|
* @return true, if successful
|
|
|
|
*/
|
|
|
|
protected static boolean checkFileExtension(String fileName, List<String> allowedFileExtension){
|
2016-01-15 11:13:48 +01:00
|
|
|
|
|
|
|
if(fileName==null || fileName.isEmpty()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
int dot = fileName.lastIndexOf(".");
|
2016-01-15 11:13:48 +01:00
|
|
|
if(dot>=0 && dot+1<=fileName.length()){
|
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
String ext = fileName.substring(dot+1, fileName.length());
|
|
|
|
_log.trace("Extension found: "+ext +" for: "+fileName);
|
|
|
|
// if(ext.isEmpty())
|
|
|
|
// return false;
|
|
|
|
for (String fe : allowedFileExtension) {
|
2016-01-15 11:13:48 +01:00
|
|
|
if(ext.compareTo(fe)==0) {
|
2015-07-29 16:23:29 +02:00
|
|
|
return true;
|
2016-01-15 11:13:48 +01:00
|
|
|
}
|
2015-07-29 16:23:29 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
_log.trace("Extension not found for: "+fileName);
|
|
|
|
return false;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
/**
|
|
|
|
* Check properties.
|
|
|
|
*
|
|
|
|
* @param item the item
|
|
|
|
* @param requestedProperties the requested properties
|
|
|
|
* @return true, if successful
|
|
|
|
* @throws InternalErrorException the internal error exception
|
|
|
|
*/
|
2015-06-24 15:16:13 +02:00
|
|
|
protected static boolean checkProperties(WorkspaceItem item, Map<String, String> requestedProperties) throws InternalErrorException
|
|
|
|
{
|
2016-01-15 11:13:48 +01:00
|
|
|
if (requestedProperties==null || requestedProperties.size()==0 || item.getType()!=WorkspaceItemType.FOLDER_ITEM) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
Map<String, String> itemProperties = item.getProperties().getProperties();
|
|
|
|
for (Entry<String, String> requestProperty:requestedProperties.entrySet()) {
|
|
|
|
String propertyValue = itemProperties.get(requestProperty.getKey());
|
2016-01-15 11:13:48 +01:00
|
|
|
if (propertyValue == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!propertyValue.equals(requestProperty.getValue())) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-24 15:16:13 +02:00
|
|
|
return true;
|
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds the folder to breadcrumbs.
|
|
|
|
*
|
|
|
|
* @param wsFolder the ws folder
|
|
|
|
* @param parent the parent
|
|
|
|
* @return the item
|
|
|
|
* @throws InternalErrorException the internal error exception
|
|
|
|
*/
|
2015-12-03 15:41:16 +01:00
|
|
|
public static Item buildFolderForBreadcrumbs(WorkspaceFolder wsFolder, Item parent) throws InternalErrorException {
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-25 12:33:18 +02:00
|
|
|
String name = "";
|
2015-06-25 18:17:10 +02:00
|
|
|
boolean isSpecialFolder = false;
|
2015-06-30 18:10:45 +02:00
|
|
|
boolean isRoot = false;
|
2015-06-30 14:52:40 +02:00
|
|
|
|
|
|
|
if(wsFolder.isRoot()){ //IS ROOT
|
|
|
|
name = WorkspaceExplorerConstants.HOME_LABEL;
|
2015-06-30 18:10:45 +02:00
|
|
|
isRoot = true;
|
2015-06-30 14:52:40 +02:00
|
|
|
}else if(wsFolder.isShared() && wsFolder.getType().equals(WorkspaceItemType.SHARED_FOLDER)){ //MANAGEMENT SHARED FOLDER NAME
|
2015-06-25 12:33:18 +02:00
|
|
|
WorkspaceSharedFolder shared = (WorkspaceSharedFolder) wsFolder;
|
|
|
|
name = shared.isVreFolder()?shared.getDisplayName():wsFolder.getName();
|
|
|
|
//MANAGEMENT SPECIAL FOLDER
|
2015-06-30 18:10:45 +02:00
|
|
|
}else if(isSpecialFolder(wsFolder)){
|
2015-06-25 12:33:18 +02:00
|
|
|
name = WorkspaceExplorerConstants.VRE_FOLDERS_LABEL;
|
2015-06-25 18:17:10 +02:00
|
|
|
isSpecialFolder = true;
|
2016-01-15 11:13:48 +01:00
|
|
|
}
|
|
|
|
else {
|
2015-06-25 12:33:18 +02:00
|
|
|
name = wsFolder.getName();
|
2016-01-15 11:13:48 +01:00
|
|
|
}
|
|
|
|
|
2015-06-30 14:52:40 +02:00
|
|
|
//BUILDS A SIMPLE ITEM FOR BREADCRUMB
|
2016-02-03 12:20:42 +01:00
|
|
|
Item item = new Item(null, wsFolder.getId(), name, ItemType.FOLDER, wsFolder.getPath(), null, true, isRoot);
|
2015-06-25 18:17:10 +02:00
|
|
|
item.setSpecialFolder(isSpecialFolder);
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-13 17:15:21 +02:00
|
|
|
_log.debug("breadcrumb returning: "+item);
|
2015-06-25 18:17:10 +02:00
|
|
|
return item;
|
2015-06-25 12:33:18 +02:00
|
|
|
}
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
/**
|
|
|
|
* Checks if is special folder.
|
|
|
|
*
|
|
|
|
* @param wsFolder the ws folder
|
|
|
|
* @return true, if is special folder
|
|
|
|
*/
|
2015-06-30 18:10:45 +02:00
|
|
|
public static boolean isSpecialFolder(WorkspaceFolder wsFolder){
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-06-30 18:10:45 +02:00
|
|
|
try {
|
2016-01-15 11:13:48 +01:00
|
|
|
return wsFolder.getName().compareTo(WorkspaceExplorerConstants.SPECIAL_FOLDERS_NAME)==0 && wsFolder.getParent()!=null && wsFolder.getParent().isRoot();
|
2015-06-30 18:10:45 +02:00
|
|
|
} catch (InternalErrorException e) {
|
|
|
|
_log.warn("isSpecialFolder exception, returning false");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2015-07-29 16:23:29 +02:00
|
|
|
/*
|
|
|
|
public static void main(String[] args) {
|
|
|
|
List<String> allowedFileExtension = new ArrayList<String>();
|
|
|
|
allowedFileExtension.add("csv");
|
|
|
|
allowedFileExtension.add("");
|
2016-01-15 11:13:48 +01:00
|
|
|
|
2015-07-29 16:23:29 +02:00
|
|
|
String fileName = "t";
|
|
|
|
System.out.println(checkFileExtension(fileName, allowedFileExtension));
|
|
|
|
}*/
|
2015-06-24 15:16:13 +02:00
|
|
|
}
|