Package org.alfresco.utility.network
Class NetworkDrive
- java.lang.Object
-
- org.alfresco.utility.network.NetworkDrive
-
public abstract class NetworkDrive extends java.lang.Object- Author:
- Paul Brodner
-
-
Constructor Summary
Constructors Constructor Description NetworkDrive(UserModel userModel, java.lang.String serverNetworkPath, java.lang.String localVolumePath)For MAC#mountOsAppcan be mount_smbfs
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidassertNetworkDriveIsMounted()voidassertNetworkDriveIsUmounted()java.io.FilecopyFile(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath)java.io.FilecopyFolder(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath)java.io.FilecreateFile(java.lang.String relativePathToLocalVolumePath)java.io.FilecreateFile(java.lang.String relativePathToLocalVolumePath, java.io.FileInputStream fileInputStream)java.io.FilecreateFolder(java.lang.String relativePathToLocalVolumePath)voiddeleteContent(java.lang.String relativePathToLocalVolumePath)java.lang.StringgetLocalVolumePath()java.lang.StringgetServerNetworkPath()UserModelgetUserForNetworkAccess()booleanisNetworkDriveMounted()voidmount()protected abstract voidmountCode()java.io.FilemoveFile(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath)java.io.FilemoveFolder(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath)java.io.FilerenameContent(java.lang.String originalRelativePath, java.lang.String renamedRelativePath)protected voidrunCommand(java.lang.String command, java.lang.Object... arguments)voidsetLocalVolumePath(java.lang.String localVolumePath)voidsetServerNetworkPath(java.lang.String serverNetworkPath)voidsetUserForNetworkAccess(UserModel userModel)protected abstract voidumountCode()voidunount()java.io.FileupdateContent(java.lang.String relativePathToLocalVolumePath, java.io.ByteArrayInputStream byteArrayInputStream)
-
-
-
Constructor Detail
-
NetworkDrive
public NetworkDrive(UserModel userModel, java.lang.String serverNetworkPath, java.lang.String localVolumePath)
For MAC#mountOsAppcan be mount_smbfs- Parameters:
mountOsapp-networkPath-localVolumePath-
-
-
Method Detail
-
mountCode
protected abstract void mountCode() throws java.lang.Exception- Throws:
java.lang.Exception
-
umountCode
protected abstract void umountCode() throws java.lang.Exception- Throws:
java.lang.Exception
-
mount
public void mount() throws java.lang.Exception- Throws:
java.lang.Exception
-
unount
public void unount() throws java.lang.Exception- Throws:
java.lang.Exception
-
getUserForNetworkAccess
public UserModel getUserForNetworkAccess()
-
setUserForNetworkAccess
public void setUserForNetworkAccess(UserModel userModel)
-
runCommand
protected void runCommand(java.lang.String command, java.lang.Object... arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
getLocalVolumePath
public java.lang.String getLocalVolumePath()
-
setLocalVolumePath
public void setLocalVolumePath(java.lang.String localVolumePath)
-
getServerNetworkPath
public java.lang.String getServerNetworkPath()
-
setServerNetworkPath
public void setServerNetworkPath(java.lang.String serverNetworkPath)
-
isNetworkDriveMounted
public boolean isNetworkDriveMounted() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNetworkDriveIsMounted
public void assertNetworkDriveIsMounted() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNetworkDriveIsUmounted
public void assertNetworkDriveIsUmounted() throws java.lang.Exception- Throws:
java.lang.Exception
-
createFile
public java.io.File createFile(java.lang.String relativePathToLocalVolumePath) throws java.io.IOException- Throws:
java.io.IOException
-
createFile
public java.io.File createFile(java.lang.String relativePathToLocalVolumePath, java.io.FileInputStream fileInputStream) throws java.io.IOException- Throws:
java.io.IOException
-
createFolder
public java.io.File createFolder(java.lang.String relativePathToLocalVolumePath) throws java.io.IOException- Throws:
java.io.IOException
-
deleteContent
public void deleteContent(java.lang.String relativePathToLocalVolumePath) throws java.io.IOException- Throws:
java.io.IOException
-
updateContent
public java.io.File updateContent(java.lang.String relativePathToLocalVolumePath, java.io.ByteArrayInputStream byteArrayInputStream) throws java.io.IOException- Throws:
java.io.IOException
-
renameContent
public java.io.File renameContent(java.lang.String originalRelativePath, java.lang.String renamedRelativePath) throws java.io.IOException- Throws:
java.io.IOException
-
copyFile
public java.io.File copyFile(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath) throws java.io.IOException- Throws:
java.io.IOException
-
copyFolder
public java.io.File copyFolder(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath) throws java.io.IOException- Throws:
java.io.IOException
-
moveFile
public java.io.File moveFile(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath) throws java.io.IOException- Throws:
java.io.IOException
-
moveFolder
public java.io.File moveFolder(java.lang.String sourceRelativePath, java.lang.String destinationRelativePath) throws java.io.IOException- Throws:
java.io.IOException
-
-