Class CifsHelper


  • public class CifsHelper
    extends Object
    Class with supplying helper methods and potentially acting as a cache for queries.
    Author:
    derekh
    • Constructor Detail

      • CifsHelper

        public CifsHelper()
        Class constructor
    • Method Detail

      • init

        public void init()
      • setDictionaryService

        public void setDictionaryService​(DictionaryService dictionaryService)
      • setNodeService

        public void setNodeService​(NodeService nodeService)
      • setFileFolderService

        public void setFileFolderService​(FileFolderService fileFolderService)
      • setMimetypeService

        public void setMimetypeService​(MimetypeService mimetypeService)
      • setPermissionService

        public void setPermissionService​(PermissionService permissionService)
      • setHiddenAspect

        public void setHiddenAspect​(HiddenAspect hiddenAspect)
      • getNodeService

        protected NodeService getNodeService()
        Return the node service
        Returns:
        NodeService
      • setExcludedTypes

        public void setExcludedTypes​(List<String> excludedTypes)
      • setReadOnlyFlagOnFolders

        public void setReadOnlyFlagOnFolders​(boolean setReadOnlyFlagOnFolders)
        Controls whether the read only flag is set on folders. This flag, when set, may cause problematic # behaviour in Windows clients and doesn't necessarily mean a folder can't be written to. See ALF-6727. Should we ever set the read only flag on folders?
        Parameters:
        setReadOnlyFlagOnFolders - the setReadOnlyFlagOnFolders to set
      • isDirectory

        public boolean isDirectory​(NodeRef nodeRef)
        Parameters:
        nodeRef -
        Returns:
        Returns true if the node is a subtype of folder
        Throws:
        AlfrescoRuntimeException - if the type is neither related to a folder or content
      • getFileInformation

        public ContentFileInfo getFileInformation​(NodeRef pathRootNodeRef,
                                                  String path,
                                                  boolean readOnly,
                                                  boolean lockedFilesAsOffline)
                                           throws FileNotFoundException
        Extract a single node's file info, where the node is reference by a path relative to an ancestor node.
        Parameters:
        pathRootNodeRef -
        path - the path
        Returns:
        Returns the existing node reference
        Throws:
        FileNotFoundException
      • getFileInformationImpl

        public ContentFileInfo getFileInformationImpl​(NodeRef pathRootNodeRef,
                                                      String path,
                                                      boolean readOnly,
                                                      boolean lockedFilesAsOffline)
                                               throws FileNotFoundException
        Extract a single node's file info, where the node is reference by a path relative to an ancestor node.
        Parameters:
        pathRootNodeRef -
        path - the path
        Returns:
        Returns the existing node reference
        Throws:
        FileNotFoundException
      • createNode

        public NodeRef createNode​(NodeRef rootNodeRef,
                                  String path,
                                  QName typeQName)
                           throws org.alfresco.jlan.server.filesys.FileExistsException
        Creates a file or directory using the given paths.

        If the directory path doesn't exist, then all the parent directories will be created. If the file path is null, then the file will not be created

        Parameters:
        rootNodeRef - the root node of the path
        path - the path to a node
        typeQName - type of fole
        Returns:
        Returns a newly created file or folder node
        Throws:
        org.alfresco.jlan.server.filesys.FileExistsException - if the file or folder already exists
      • getNodeRefs

        public List<NodeRef> getNodeRefs​(NodeRef pathRootNodeRef,
                                         String path)
        Finds the nodes being reference by the given directory and file paths.

        Examples of the path are:

        • \New Folder\New Text Document.txt
        • \New Folder\Sub Folder
        Parameters:
        pathRootNodeRef - the node from which to start the path search
        path - the search path to either a folder or file
        Returns:
        Returns references to all matching nodes
      • relinkNode

        public void relinkNode​(NodeRef tempNodeRef,
                               NodeRef nodeToMoveRef,
                               NodeRef newParentNodeRef,
                               String newName)
                        throws FileNotFoundException,
                               org.alfresco.jlan.server.filesys.FileExistsException
        Relink the content data from a new node to an existing node to preserve the version history.
        Parameters:
        tempNodeRef - temp nodeRef
        nodeToMoveRef - NodeRef
        newParentNodeRef - NodeRef
        newName - new name
        Throws:
        FileNotFoundException
        org.alfresco.jlan.server.filesys.FileExistsException
      • move

        public void move​(NodeRef nodeToMoveRef,
                         NodeRef oldParent,
                         NodeRef newParentNodeRef,
                         String newName)
                  throws org.alfresco.jlan.server.filesys.FileExistsException
        Deprecated.
        - not used by live code - exception handling is too severe
        Move a node
        Parameters:
        nodeToMoveRef - Node to be moved
        newParentNodeRef - New parent folder node
        newName - New name for the moved node
        Throws:
        org.alfresco.jlan.server.filesys.FileExistsException
      • rename

        public void rename​(NodeRef nodeToRenameRef,
                           String newName)
                    throws org.alfresco.jlan.server.filesys.FileExistsException
        Deprecated.
        - not used by live code - exception handling is too severe
        Rename a node
        Parameters:
        nodeToRenameRef - Node to be renamed
        newName - New name for the node
        Throws:
        org.alfresco.jlan.server.filesys.FileExistsException
      • getFileName

        public String getFileName​(NodeRef nodeRef)
        Return the file name for a node
        Parameters:
        nodeRef - NodeRef of node to get the file name
        Returns:
        String or null if the nodeRef is not valid
      • getFileNameImpl

        public String getFileNameImpl​(NodeRef node)
        Return the file name for a node
        Parameters:
        node - NodeRef
        Returns:
        String
      • isFolderEmpty

        public boolean isFolderEmpty​(NodeRef folderNode)
        Check if the folder node is empty
        Parameters:
        folderNode - NodeRef
        Returns:
        boolean
      • setLockService

        public void setLockService​(LockService lockService)
      • setRetryingTransactionHelper

        public void setRetryingTransactionHelper​(RetryingTransactionHelper retryingTransactionHelper)