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
Fields Modifier and Type Field Description protected FTPPropertiesfTPPropertiesjava.io.FilelastDownloadedFileintreplyCodestatic java.lang.StringSTEP_PREFIXprotected org.alfresco.utility.TasPropertiestasProperties
-
Constructor Summary
Constructors Constructor Description FTPWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FTPWrapperappendContent(java.lang.String content)Append content to fileFTPAssertionassertThat()FTPWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel)FTPWrapperauthenticateUser(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)FTPWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel, java.lang.String server, int port)FTPWrapperchangeWorkingDirectory(java.lang.String newFolder)FTPWrappercopyTo(org.alfresco.utility.model.ContentModel destination)FTPWrappercreateFile(org.alfresco.utility.model.FileModel fileModel)FTPWrappercreateFile(org.alfresco.utility.model.FileModel fileModel, int fileSize)FTPWrappercreateFolder(org.alfresco.utility.model.FolderModel folderModel)FTPWrappercreateOfficeFile(org.alfresco.utility.model.FileModel fileModel)Create Office file which will be used in Integration tests by AOSFTPWrapperdelete()FTPWrapperdelete(java.lang.String path)FTPWrapperdisconnect()FTPWrapperdownloadFileTo(org.alfresco.utility.model.FolderModel destination)Download file locally, returning the new locationorg.apache.commons.net.ftp.FTPClientgetClient()java.lang.StringgetCurrentDirectory()java.lang.StringgetDataDictionaryPath()java.lang.StringgetDocumentLibraryPath(org.alfresco.utility.model.SiteModel siteModel)java.util.List<org.alfresco.utility.model.FileModel>getFiles()java.util.List<org.alfresco.utility.model.FolderModel>getFolders()java.lang.StringgetModificationTime()Get modification time of last resourcejava.lang.StringgetPrefixSpace()protected java.lang.StringgetProtocolJMXConfigurationStatus()java.lang.StringgetRootPath()java.lang.StringgetSitesPath()java.lang.StringgetUserHomesPath()FTPWrappermoveTo(org.alfresco.utility.model.ContentModel destination)FTPWrapperrename(java.lang.String newName)FTPWrapperupdate(java.lang.String newContent)FTPWrapperuploadFile(java.io.File file)Upload file from disk via FTP protocolFTPWrapperuploadFile(java.lang.String pathToFile)Upload file from disk via FTP protocolFTPWrapperusingResource(org.alfresco.utility.model.ContentModel model)FTPWrapperusingRoot()FTPWrapperusingSite(java.lang.String siteId)FTPWrapperusingSite(org.alfresco.utility.model.SiteModel siteModel)FTPWrapperusingUserHome()FTPWrapperusingUserHome(java.lang.String username)FTPUtilwithFtpUtil()JmxUtilwithJMX()-
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, when
-
-
-
-
Field Detail
-
fTPProperties
@Autowired protected FTPProperties fTPProperties
-
tasProperties
@Autowired protected org.alfresco.utility.TasProperties tasProperties
-
STEP_PREFIX
public static java.lang.String STEP_PREFIX
-
replyCode
public int replyCode
-
lastDownloadedFile
public java.io.File lastDownloadedFile
-
-
Method Detail
-
getClient
public org.apache.commons.net.ftp.FTPClient getClient()
-
authenticateUser
public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel) throws java.lang.Exception
- Specified by:
authenticateUserin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
authenticateUser
public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel, java.lang.String server, int port) throws java.lang.Exception
- Throws:
java.lang.Exception
-
authenticateUser
public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel, int fileTransferMode) throws java.lang.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:
java.lang.Exception
-
createFolder
public FTPWrapper createFolder(org.alfresco.utility.model.FolderModel folderModel) throws java.lang.Exception
- Specified by:
createFolderin interfaceorg.alfresco.utility.dsl.DSLFolder<FTPWrapper>- Throws:
java.lang.Exception
-
getPrefixSpace
public java.lang.String getPrefixSpace()
- Specified by:
getPrefixSpacein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
-
getProtocolJMXConfigurationStatus
protected java.lang.String getProtocolJMXConfigurationStatus() throws java.lang.Exception- Specified by:
getProtocolJMXConfigurationStatusin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
disconnect
public FTPWrapper disconnect() throws java.lang.Exception
- Specified by:
disconnectin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
changeWorkingDirectory
public FTPWrapper changeWorkingDirectory(java.lang.String newFolder) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getCurrentDirectory
public java.lang.String getCurrentDirectory() throws java.lang.Exception- Throws:
java.lang.Exception
-
getRootPath
public java.lang.String getRootPath() throws org.alfresco.utility.exception.TestConfigurationException- 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, java.lang.Exception
- Specified by:
usingRootin interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Overrides:
usingRootin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationExceptionjava.lang.Exception
-
usingUserHome
public FTPWrapper usingUserHome() throws org.alfresco.utility.exception.TestConfigurationException, java.lang.Exception
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationExceptionjava.lang.Exception
-
getFiles
public java.util.List<org.alfresco.utility.model.FileModel> getFiles() throws java.lang.Exception- Specified by:
getFilesin interfaceorg.alfresco.utility.dsl.DSLFile<FTPWrapper>- Throws:
java.lang.Exception
-
getFolders
public java.util.List<org.alfresco.utility.model.FolderModel> getFolders() throws java.lang.Exception- Specified by:
getFoldersin interfaceorg.alfresco.utility.dsl.DSLFolder<FTPWrapper>- Throws:
java.lang.Exception
-
getSitesPath
public java.lang.String getSitesPath() throws org.alfresco.utility.exception.TestConfigurationException- 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
public java.lang.String getUserHomesPath() throws org.alfresco.utility.exception.TestConfigurationException- 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 java.lang.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
public FTPWrapper usingSite(java.lang.String siteId) throws java.lang.Exception
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
usingSite
public FTPWrapper usingSite(org.alfresco.utility.model.SiteModel siteModel) throws java.lang.Exception
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
usingUserHome
public FTPWrapper usingUserHome(java.lang.String username) throws java.lang.Exception
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
usingResource
public FTPWrapper usingResource(org.alfresco.utility.model.ContentModel model) throws java.lang.Exception
- Specified by:
usingResourcein interfaceorg.alfresco.utility.dsl.DSL<FTPWrapper>- Specified by:
usingResourcein classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>- Throws:
java.lang.Exception
-
rename
public FTPWrapper rename(java.lang.String newName) throws java.lang.Exception
- Specified by:
renamein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
java.lang.Exception
-
update
public FTPWrapper update(java.lang.String newContent) throws java.lang.Exception
- Specified by:
updatein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
java.lang.Exception
-
appendContent
public FTPWrapper appendContent(java.lang.String content) throws java.lang.Exception
Append content to file- Parameters:
content-- Returns:
- Throws:
java.lang.Exception
-
delete
public FTPWrapper delete() throws java.lang.Exception
- Specified by:
deletein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
java.lang.Exception
-
delete
public FTPWrapper delete(java.lang.String path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
copyTo
public FTPWrapper copyTo(org.alfresco.utility.model.ContentModel destination) throws java.lang.Exception
- Specified by:
copyToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
java.lang.Exception
-
moveTo
public FTPWrapper moveTo(org.alfresco.utility.model.ContentModel destination) throws java.lang.Exception
- Specified by:
moveToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>- Throws:
java.lang.Exception
-
createFile
public FTPWrapper createFile(org.alfresco.utility.model.FileModel fileModel) throws java.lang.Exception
- Specified by:
createFilein interfaceorg.alfresco.utility.dsl.DSLFile<FTPWrapper>- Throws:
java.lang.Exception
-
createFile
public FTPWrapper createFile(org.alfresco.utility.model.FileModel fileModel, int fileSize) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createOfficeFile
public FTPWrapper createOfficeFile(org.alfresco.utility.model.FileModel fileModel) throws java.lang.Exception
Create Office file which will be used in Integration tests by AOS- Parameters:
fileModel-- Returns:
- Throws:
java.lang.Exception
-
uploadFile
public FTPWrapper uploadFile(java.lang.String pathToFile) throws java.lang.Exception
Upload file from disk via FTP protocol- Parameters:
pathToFile-- Returns:
- Throws:
java.lang.Exception
-
uploadFile
public FTPWrapper uploadFile(java.io.File file) throws java.lang.Exception
Upload file from disk via FTP protocol- Parameters:
file-File- Returns:
- Throws:
java.lang.Exception
-
withJMX
public JmxUtil withJMX()
- Returns:
- JMX DSL for this wrapper
-
withFtpUtil
public FTPUtil withFtpUtil()
-
assertThat
public FTPAssertion assertThat()
- Overrides:
assertThatin classorg.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
-
getDocumentLibraryPath
public java.lang.String getDocumentLibraryPath(org.alfresco.utility.model.SiteModel siteModel) throws org.alfresco.utility.exception.TestConfigurationException, java.lang.Exception- Throws:
org.alfresco.utility.exception.TestConfigurationExceptionjava.lang.Exception
-
downloadFileTo
public FTPWrapper downloadFileTo(org.alfresco.utility.model.FolderModel destination) throws java.lang.Exception
Download file locally, returning the new location- Parameters:
destination-- Returns:
- Throws:
java.lang.Exception
-
getModificationTime
public java.lang.String getModificationTime() throws java.lang.ExceptionGet modification time of last resource- Returns:
- Throws:
java.lang.Exception
-
-