Class SharedDriveHelpers
- java.lang.Object
-
- org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveHelpers
-
public class SharedDriveHelpers extends java.lang.Object
This class contains test code that is useful for performing test operations using JCifs from the appliance. Basic operations are: addDocument, deleteDocument, addFolderUser, and deleteFolderUser.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
-
Constructor Summary
Constructors Constructor Description SharedDriveHelpers(java.lang.String serverName, java.lang.String userName, java.lang.String password)
Construct the helper and initialize the connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addDocument(java.lang.String targetPath, java.lang.String sourceFile)
Add a document.void
addUserToFolder(java.lang.String targetPath, java.lang.String userName)
Add user ACL to folder.void
close()
Close the connection.void
deleteDocument(java.lang.String targetPath)
Delete a document.java.lang.String
lookupDocument(java.lang.String targetPath)
See if a document exists.protected java.lang.String
mapToIdentifier(java.lang.String path)
Map a "path" specification to a full identifier.void
removeUserFromFolder(java.lang.String targetPath, java.lang.String userName)
Remove user ACL from folder.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SharedDriveHelpers
public SharedDriveHelpers(java.lang.String serverName, java.lang.String userName, java.lang.String password) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Construct the helper and initialize the connection.- Parameters:
serverName
- is the DNS name of the server.userName
- is the name to use to log in.password
- is the password.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-
Method Detail
-
close
public void close() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Close the connection.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
lookupDocument
public java.lang.String lookupDocument(java.lang.String targetPath) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
See if a document exists.- Parameters:
targetPath
- is the document's path, beginning with the share name and separated by "/" characters.- Returns:
- the target path if the document is found, or "" if it is not.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
addDocument
public java.lang.String addDocument(java.lang.String targetPath, java.lang.String sourceFile) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Add a document.- Parameters:
targetPath
- is the target path, beginning with the share name and separated by "/" characters.sourceFile
- is the local source file name to copy to the target.- Returns:
- the target path.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
deleteDocument
public void deleteDocument(java.lang.String targetPath) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Delete a document.- Parameters:
targetPath
- is the file path to delete, beginning with the share name and separated by "/" characters.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
addUserToFolder
public void addUserToFolder(java.lang.String targetPath, java.lang.String userName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Add user ACL to folder.- Parameters:
targetPath
- is the folder path to add the acl to, beginning with the share name and separated by "/" characters.userName
- is the user to add.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
removeUserFromFolder
public void removeUserFromFolder(java.lang.String targetPath, java.lang.String userName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Remove user ACL from folder.- Parameters:
targetPath
- is the folder path to add the acl to, beginning with the share name and separated by "/" characters.userName
- is the user to remove.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
mapToIdentifier
protected java.lang.String mapToIdentifier(java.lang.String path) throws java.io.IOException
Map a "path" specification to a full identifier.- Throws:
java.io.IOException
-
-