mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-10826: tidy up, added to comments/javadocs
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32804 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -216,7 +216,6 @@ public class FilenameFilteringInterceptor implements MethodInterceptor
|
|||||||
ret = invocation.proceed();
|
ret = invocation.proceed();
|
||||||
|
|
||||||
FileInfoImpl fileInfo = (FileInfoImpl)ret;
|
FileInfoImpl fileInfo = (FileInfoImpl)ret;
|
||||||
// NodeRef retNodeRef = fileInfo.getNodeRef();
|
|
||||||
|
|
||||||
if(isSystemPath(nodeRef, filename))
|
if(isSystemPath(nodeRef, filename))
|
||||||
{
|
{
|
||||||
@@ -237,7 +236,6 @@ public class FilenameFilteringInterceptor implements MethodInterceptor
|
|||||||
ret = invocation.proceed();
|
ret = invocation.proceed();
|
||||||
|
|
||||||
FileInfoImpl fileInfo = (FileInfoImpl)ret;
|
FileInfoImpl fileInfo = (FileInfoImpl)ret;
|
||||||
//NodeRef retNodeRef = fileInfo.getNodeRef();
|
|
||||||
|
|
||||||
checkTemporaryAspect(temporaryFiles.isFiltered(filename), fileInfo);
|
checkTemporaryAspect(temporaryFiles.isFiltered(filename), fileInfo);
|
||||||
hiddenAspect.checkHidden(fileInfo);
|
hiddenAspect.checkHidden(fileInfo);
|
||||||
@@ -251,7 +249,6 @@ public class FilenameFilteringInterceptor implements MethodInterceptor
|
|||||||
|
|
||||||
FileInfoImpl fileInfo = (FileInfoImpl) ret;
|
FileInfoImpl fileInfo = (FileInfoImpl) ret;
|
||||||
String filename = fileInfo.getName();
|
String filename = fileInfo.getName();
|
||||||
// NodeRef retNodeRef = fileInfo.getNodeRef();
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
@@ -261,7 +258,6 @@ public class FilenameFilteringInterceptor implements MethodInterceptor
|
|||||||
// check against all the regular expressions
|
// check against all the regular expressions
|
||||||
checkTemporaryAspect(temporaryFiles.isFiltered(filename), fileInfo);
|
checkTemporaryAspect(temporaryFiles.isFiltered(filename), fileInfo);
|
||||||
hiddenAspect.checkHidden(fileInfo);
|
hiddenAspect.checkHidden(fileInfo);
|
||||||
// hiddenAspect.checkHidden(retNodeRef);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -11,13 +11,11 @@ import java.util.Set;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.repository.Path;
|
import org.alfresco.service.cmr.repository.Path;
|
||||||
import org.alfresco.service.cmr.repository.Path.Element;
|
import org.alfresco.service.cmr.repository.Path.Element;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.FileFilterMode;
|
|
||||||
import org.alfresco.util.FileFilterMode.Client;
|
import org.alfresco.util.FileFilterMode.Client;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
@@ -159,7 +157,7 @@ public class HiddenAspect
|
|||||||
return Visibility.getVisibility(mask);
|
return Visibility.getVisibility(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Determines whether the path matches any one of the hidden file patterns and, if so,
|
* Determines whether the path matches any one of the hidden file patterns and, if so,
|
||||||
* returns the matching pattern.
|
* returns the matching pattern.
|
||||||
*
|
*
|
||||||
@@ -245,6 +243,12 @@ public class HiddenAspect
|
|||||||
addIndexControlAspect(nodeRef);
|
addIndexControlAspect(nodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.
|
||||||
|
*
|
||||||
|
* @param fileInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public void checkHidden(FileInfoImpl fileInfo)
|
public void checkHidden(FileInfoImpl fileInfo)
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||||
@@ -255,6 +259,14 @@ public class HiddenAspect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides the node by applying the hidden and not indexed aspects. The node will be hidden from clients
|
||||||
|
* according to the visibility mask.
|
||||||
|
*
|
||||||
|
* @param client
|
||||||
|
* @param fileInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public void hideNode(FileInfoImpl fileInfo, int visibilityMask)
|
public void hideNode(FileInfoImpl fileInfo, int visibilityMask)
|
||||||
{
|
{
|
||||||
hideNode(fileInfo.getNodeRef(), visibilityMask);
|
hideNode(fileInfo.getNodeRef(), visibilityMask);
|
||||||
@@ -264,7 +276,6 @@ public class HiddenAspect
|
|||||||
/**
|
/**
|
||||||
* Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.
|
* Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.
|
||||||
*
|
*
|
||||||
* @param client
|
|
||||||
* @param fileInfo
|
* @param fileInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -340,33 +351,6 @@ public class HiddenAspect
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the list of files with hidden files filtered out if required for the given client.
|
|
||||||
*
|
|
||||||
* @param client
|
|
||||||
* @param files
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// public List<FileInfo> removeHiddenFiles(Client client, List<FileInfo> files)
|
|
||||||
// {
|
|
||||||
// // TODO bulk load aspects and properties of nodes first?
|
|
||||||
// List<FileInfo> ret = new ArrayList<FileInfo>(files.size());
|
|
||||||
// int numHiddenFiles = 0;
|
|
||||||
//
|
|
||||||
// for(FileInfo file : files)
|
|
||||||
// {
|
|
||||||
// if(getVisibility(client, file.getNodeRef()) == Visibility.NotVisible)
|
|
||||||
// {
|
|
||||||
// numHiddenFiles++;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ret.add(file);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return ret;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private class HiddenFileInfoImpl implements HiddenFileInfo
|
private class HiddenFileInfoImpl implements HiddenFileInfo
|
||||||
{
|
{
|
||||||
private Pattern filter;
|
private Pattern filter;
|
||||||
|
@@ -3,6 +3,12 @@ package org.alfresco.repo.model.filefolder;
|
|||||||
import org.alfresco.util.PropertyCheck;
|
import org.alfresco.util.PropertyCheck;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spring bean defining a hidden node filter.
|
||||||
|
*
|
||||||
|
* @since 4.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class HiddenFileFilter implements InitializingBean
|
public class HiddenFileFilter implements InitializingBean
|
||||||
{
|
{
|
||||||
private String filter;
|
private String filter;
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
package org.alfresco.repo.model.filefolder;
|
package org.alfresco.repo.model.filefolder;
|
||||||
|
|
||||||
import java.util.Set;
|
/**
|
||||||
|
* Represents hidden file information, including the filter (regular expression) and the visibility mask.
|
||||||
import org.alfresco.util.FileFilterMode.Client;
|
*
|
||||||
|
* @since 4.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface HiddenFileInfo
|
public interface HiddenFileInfo
|
||||||
{
|
{
|
||||||
public Set<Client> getVisibility();
|
|
||||||
public int getVisibilityMask();
|
public int getVisibilityMask();
|
||||||
public String getFilter();
|
public String getFilter();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user