Package org.alfresco.ftp
Class FTPWrapper
java.lang.Object
org.alfresco.utility.dsl.DSLWrapper<Client>
org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
org.alfresco.ftp.FTPWrapper
- All Implemented Interfaces:
org.alfresco.utility.dsl.DSL<FTPWrapper>,org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>,org.alfresco.utility.dsl.DSLFile<FTPWrapper>,org.alfresco.utility.dsl.DSLFolder<FTPWrapper>
@Service
@Scope("prototype")
public class FTPWrapper
extends org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
implements org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>, org.alfresco.utility.dsl.DSLFolder<FTPWrapper>, org.alfresco.utility.dsl.DSLFile<FTPWrapper>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FTPPropertiesintstatic Stringprotected org.alfresco.utility.TasPropertiesFields inherited from class org.alfresco.utility.dsl.DSLWrapper
contentService, dataContent, jmxBuilder, LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendContent(String content) Append content to fileauthenticateUser(org.alfresco.utility.model.UserModel userModel) authenticateUser(org.alfresco.utility.model.UserModel userModel, int fileTransferMode) Authenticate user and set the file transfer mode (useFTP) codes: 10 - FTP.STREAM_TRANSFER_MODE, 11 - FTP.BLOCK_TRANSFER_MODE, 12 - FTP.COMPRESSED_TRANSFER_MODE)authenticateUser(org.alfresco.utility.model.UserModel userModel, String server, int port) changeWorkingDirectory(String newFolder) copyTo(org.alfresco.utility.model.ContentModel destination) createFile(org.alfresco.utility.model.FileModel fileModel) createFile(org.alfresco.utility.model.FileModel fileModel, int fileSize) createFolder(org.alfresco.utility.model.FolderModel folderModel) createOfficeFile(org.alfresco.utility.model.FileModel fileModel) Create Office file which will be used in Integration tests by AOSdelete()downloadFileTo(org.alfresco.utility.model.FolderModel destination) Download file locally, returning the new locationorg.apache.commons.net.ftp.FTPClientgetDocumentLibraryPath(org.alfresco.utility.model.SiteModel siteModel) List<org.alfresco.utility.model.FileModel>getFiles()List<org.alfresco.utility.model.FolderModel>Get modification time of last resourceprotected StringmoveTo(org.alfresco.utility.model.ContentModel destination) uploadFile(File file) Upload file from disk via FTP protocoluploadFile(String pathToFile) Upload file from disk via FTP protocolusingResource(org.alfresco.utility.model.ContentModel model) usingSite(org.alfresco.utility.model.SiteModel siteModel) usingUserHome(String username) withJMX()Methods inherited from class org.alfresco.utility.dsl.DSLProtocol
and, buildPath, buildSiteDocumentLibraryPath, buildUserHomePath, closeJmxConnection, getCurrentSpace, getCurrentUser, getLastContentModel, getLastResource, getLastResourceWithoutPrefix, getProtocolName, isProtocolEnabled, setCurrentSpace, setLastContentModel, setLastResource, then, usingAdmin, usingUser, waitSeconds, whenMethods inherited from class org.alfresco.utility.dsl.DSLWrapper
getDataContentService, getTestUser, setTestUser
-
Field Details
-
fTPProperties
-
tasProperties
@Autowired protected org.alfresco.utility.TasProperties tasProperties -
STEP_PREFIX
-
replyCode
public int replyCode -
lastDownloadedFile
-
-
Constructor Details
-
FTPWrapper
public FTPWrapper()
-
-
Method Details
-
getClient
public org.apache.commons.net.ftp.FTPClient getClient() -
authenticateUser
- Specified by:
authenticateUserin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
authenticateUser
public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel, String server, int port) throws Exception - Throws:
Exception
-
authenticateUser
public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel, int fileTransferMode) throws Exception Authenticate user and set the file transfer mode (useFTP) codes: 10 - FTP.STREAM_TRANSFER_MODE, 11 - FTP.BLOCK_TRANSFER_MODE, 12 - FTP.COMPRESSED_TRANSFER_MODE)- Parameters:
userModel-fileTransferMode-- Returns:
- Throws:
Exception
-
createFolder
- Specified by:
createFolderin interfaceorg.alfresco.utility.dsl.DSLFolder<FTPWrapper>- Throws:
Exception
-
getPrefixSpace
- Specified by:
getPrefixSpacein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
-
getProtocolJMXConfigurationStatus
- Specified by:
getProtocolJMXConfigurationStatusin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
disconnect
- Specified by:
disconnectin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
changeWorkingDirectory
- Throws:
Exception
-
getCurrentDirectory
- Throws:
Exception
-
getRootPath
- Specified by:
getRootPathin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
getRootPathin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
usingRoot
public FTPWrapper usingRoot() throws org.alfresco.utility.exception.TestConfigurationException, Exception- Specified by:
usingRootin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Overrides:
usingRootin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationExceptionException
-
usingUserHome
public FTPWrapper usingUserHome() throws org.alfresco.utility.exception.TestConfigurationException, Exception- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationExceptionException
-
getFiles
- Specified by:
getFilesin interfaceorg.alfresco.utility.dsl.DSLFile<FTPWrapper>- Throws:
Exception
-
getFolders
- Specified by:
getFoldersin interfaceorg.alfresco.utility.dsl.DSLFolder<FTPWrapper>- Throws:
Exception
-
getSitesPath
- Specified by:
getSitesPathin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
getSitesPathin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getUserHomesPath
- Specified by:
getUserHomesPathin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
getUserHomesPathin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getDataDictionaryPath
public String getDataDictionaryPath() throws org.alfresco.utility.exception.TestConfigurationException- Specified by:
getDataDictionaryPathin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
getDataDictionaryPathin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
usingSite
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
usingSite
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
usingUserHome
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
usingResource
- Specified by:
usingResourcein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingResourcein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
Exception
-
rename
- Specified by:
renamein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
Exception
-
update
- Specified by:
updatein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
Exception
-
appendContent
Append content to file- Parameters:
content-- Returns:
- Throws:
Exception
-
delete
- Specified by:
deletein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
Exception
-
delete
- Throws:
Exception
-
copyTo
- Specified by:
copyToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
Exception
-
moveTo
- Specified by:
moveToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
Exception
-
createFile
- Specified by:
createFilein interfaceorg.alfresco.utility.dsl.DSLFile<FTPWrapper>- Throws:
Exception
-
createFile
public FTPWrapper createFile(org.alfresco.utility.model.FileModel fileModel, int fileSize) throws Exception - Throws:
Exception
-
createOfficeFile
Create Office file which will be used in Integration tests by AOS- Parameters:
fileModel-- Returns:
- Throws:
Exception
-
uploadFile
Upload file from disk via FTP protocol- Parameters:
pathToFile-- Returns:
- Throws:
Exception
-
uploadFile
Upload file from disk via FTP protocol -
withJMX
- Returns:
- JMX DSL for this wrapper
-
withFtpUtil
-
assertThat
- Overrides:
assertThatin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
-
getDocumentLibraryPath
public String getDocumentLibraryPath(org.alfresco.utility.model.SiteModel siteModel) throws org.alfresco.utility.exception.TestConfigurationException, Exception - Throws:
org.alfresco.utility.exception.TestConfigurationExceptionException
-
downloadFileTo
public FTPWrapper downloadFileTo(org.alfresco.utility.model.FolderModel destination) throws Exception Download file locally, returning the new location- Parameters:
destination-- Returns:
- Throws:
Exception
-
getModificationTime
Get modification time of last resource- Returns:
- Throws:
Exception
-