Package org.alfresco.filesys.repo
Class CifsHelper
java.lang.Object
org.alfresco.filesys.repo.CifsHelper
Class with supplying helper methods and potentially acting as a cache for queries.
- Author:
- derekh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNode(NodeRef rootNodeRef, String path, QName typeQName) Creates a file or directory using the given paths.getFileInformation(NodeRef nodeRef, boolean readOnly, boolean lockedFilesAsOffline) getFileInformation(NodeRef pathRootNodeRef, String path, boolean readOnly, boolean lockedFilesAsOffline) Extract a single node's file info, where the node is reference by a path relative to an ancestor node.getFileInformationImpl(NodeRef pathRootNodeRef, String path, boolean readOnly, boolean lockedFilesAsOffline) Extract a single node's file info, where the node is reference by a path relative to an ancestor node.getFileName(NodeRef nodeRef) Return the file name for a nodegetFileNameImpl(NodeRef node) Return the file name for a nodegetNodeRef(NodeRef pathRootNodeRef, String path) Attempts to fetch a specific single node at the given path.getNodeRefs(NodeRef pathRootNodeRef, String path) Finds the nodes being reference by the given directory and file paths.protected NodeServiceReturn the node servicevoidinit()booleanisDirectory(NodeRef nodeRef) booleanisFolderEmpty(NodeRef folderNode) Check if the folder node is emptyvoidDeprecated.- not used by live code - exception handling is too severevoidrelinkNode(NodeRef tempNodeRef, NodeRef nodeToMoveRef, NodeRef newParentNodeRef, String newName) Relink the content data from a new node to an existing node to preserve the version history.voidDeprecated.- not used by live code - exception handling is too severevoidsetDictionaryService(DictionaryService dictionaryService) voidsetExcludedTypes(List<String> excludedTypes) voidsetFileFolderService(FileFolderService fileFolderService) voidsetHiddenAspect(HiddenAspect hiddenAspect) voidsetLockService(LockService lockService) voidsetMimetypeService(MimetypeService mimetypeService) voidsetNodeService(NodeService nodeService) voidsetPermissionService(PermissionService permissionService) voidsetReadOnlyFlagOnFolders(boolean setReadOnlyFlagOnFolders) Controls whether the read only flag is set on folders.voidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
-
Constructor Details
-
CifsHelper
public CifsHelper()Class constructor
-
-
Method Details
-
init
public void init() -
setDictionaryService
-
setNodeService
-
setFileFolderService
-
setMimetypeService
-
setPermissionService
-
setHiddenAspect
-
getNodeService
Return the node service- Returns:
- NodeService
-
setExcludedTypes
-
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
- Parameters:
nodeRef-- Returns:
- Returns true if the node is a subtype of
folder - Throws:
org.alfresco.error.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
-
getFileInformation
public ContentFileInfo getFileInformation(NodeRef nodeRef, boolean readOnly, boolean lockedFilesAsOffline) throws FileNotFoundException - 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 pathpath- the path to a nodetypeQName- 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
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 searchpath- the search path to either a folder or file- Returns:
- Returns references to all matching nodes
-
getNodeRef
Attempts to fetch a specific single node at the given path.The path may contain wild cards
- Throws:
FileNotFoundException- if the path can't be resolved to a node- See Also:
-
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 nodeRefnodeToMoveRef- NodeRefnewParentNodeRef- NodeRefnewName- new name- Throws:
FileNotFoundExceptionorg.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 severeMove a node- Parameters:
nodeToMoveRef- Node to be movednewParentNodeRef- New parent folder nodenewName- 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 severeRename a node- Parameters:
nodeToRenameRef- Node to be renamednewName- New name for the node- Throws:
org.alfresco.jlan.server.filesys.FileExistsException
-
getFileName
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
Return the file name for a node- Parameters:
node- NodeRef- Returns:
- String
-
isFolderEmpty
Check if the folder node is empty- Parameters:
folderNode- NodeRef- Returns:
- boolean
-
setLockService
-
getLockService
-
setRetryingTransactionHelper
-
getRetryingTransactionHelper
-