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 Details

    • fTPProperties

      @Autowired protected FTPProperties fTPProperties
    • tasProperties

      @Autowired protected org.alfresco.utility.TasProperties tasProperties
    • STEP_PREFIX

      public static String STEP_PREFIX
    • replyCode

      public int replyCode
    • lastDownloadedFile

      public File lastDownloadedFile
  • Constructor Details

    • FTPWrapper

      public FTPWrapper()
  • Method Details

    • getClient

      public org.apache.commons.net.ftp.FTPClient getClient()
    • authenticateUser

      public FTPWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel) throws Exception
      Specified by:
      authenticateUser in class org.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 (use FTP) codes: 10 - FTP.STREAM_TRANSFER_MODE, 11 - FTP.BLOCK_TRANSFER_MODE, 12 - FTP.COMPRESSED_TRANSFER_MODE)
      Parameters:
      userModel -
      fileTransferMode -
      Returns:
      Throws:
      Exception
    • createFolder

      public FTPWrapper createFolder(org.alfresco.utility.model.FolderModel folderModel) throws Exception
      Specified by:
      createFolder in interface org.alfresco.utility.dsl.DSLFolder<FTPWrapper>
      Throws:
      Exception
    • getPrefixSpace

      public String getPrefixSpace()
      Specified by:
      getPrefixSpace in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
    • getProtocolJMXConfigurationStatus

      protected String getProtocolJMXConfigurationStatus() throws Exception
      Specified by:
      getProtocolJMXConfigurationStatus in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • disconnect

      public FTPWrapper disconnect() throws Exception
      Specified by:
      disconnect in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • changeWorkingDirectory

      public FTPWrapper changeWorkingDirectory(String newFolder) throws Exception
      Throws:
      Exception
    • getCurrentDirectory

      public String getCurrentDirectory() throws Exception
      Throws:
      Exception
    • getRootPath

      public String getRootPath() throws org.alfresco.utility.exception.TestConfigurationException
      Specified by:
      getRootPath in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      getRootPath in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
    • usingRoot

      public FTPWrapper usingRoot() throws org.alfresco.utility.exception.TestConfigurationException, Exception
      Specified by:
      usingRoot in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Overrides:
      usingRoot in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
      Exception
    • usingUserHome

      public FTPWrapper usingUserHome() throws org.alfresco.utility.exception.TestConfigurationException, Exception
      Specified by:
      usingUserHome in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      usingUserHome in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
      Exception
    • getFiles

      public List<org.alfresco.utility.model.FileModel> getFiles() throws Exception
      Specified by:
      getFiles in interface org.alfresco.utility.dsl.DSLFile<FTPWrapper>
      Throws:
      Exception
    • getFolders

      public List<org.alfresco.utility.model.FolderModel> getFolders() throws Exception
      Specified by:
      getFolders in interface org.alfresco.utility.dsl.DSLFolder<FTPWrapper>
      Throws:
      Exception
    • getSitesPath

      public String getSitesPath() throws org.alfresco.utility.exception.TestConfigurationException
      Specified by:
      getSitesPath in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      getSitesPath in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
    • getUserHomesPath

      public String getUserHomesPath() throws org.alfresco.utility.exception.TestConfigurationException
      Specified by:
      getUserHomesPath in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      getUserHomesPath in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
    • getDataDictionaryPath

      public String getDataDictionaryPath() throws org.alfresco.utility.exception.TestConfigurationException
      Specified by:
      getDataDictionaryPath in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      getDataDictionaryPath in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      org.alfresco.utility.exception.TestConfigurationException
    • usingSite

      public FTPWrapper usingSite(String siteId) throws Exception
      Specified by:
      usingSite in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      usingSite in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • usingSite

      public FTPWrapper usingSite(org.alfresco.utility.model.SiteModel siteModel) throws Exception
      Specified by:
      usingSite in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      usingSite in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • usingUserHome

      public FTPWrapper usingUserHome(String username) throws Exception
      Specified by:
      usingUserHome in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      usingUserHome in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • usingResource

      public FTPWrapper usingResource(org.alfresco.utility.model.ContentModel model) throws Exception
      Specified by:
      usingResource in interface org.alfresco.utility.dsl.DSL<FTPWrapper>
      Specified by:
      usingResource in class org.alfresco.utility.dsl.DSLProtocol<FTPWrapper>
      Throws:
      Exception
    • rename

      public FTPWrapper rename(String newName) throws Exception
      Specified by:
      rename in interface org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>
      Throws:
      Exception
    • update

      public FTPWrapper update(String newContent) throws Exception
      Specified by:
      update in interface org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>
      Throws:
      Exception
    • appendContent

      public FTPWrapper appendContent(String content) throws Exception
      Append content to file
      Parameters:
      content -
      Returns:
      Throws:
      Exception
    • delete

      public FTPWrapper delete() throws Exception
      Specified by:
      delete in interface org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>
      Throws:
      Exception
    • delete

      public FTPWrapper delete(String path) throws Exception
      Throws:
      Exception
    • copyTo

      public FTPWrapper copyTo(org.alfresco.utility.model.ContentModel destination) throws Exception
      Specified by:
      copyTo in interface org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>
      Throws:
      Exception
    • moveTo

      public FTPWrapper moveTo(org.alfresco.utility.model.ContentModel destination) throws Exception
      Specified by:
      moveTo in interface org.alfresco.utility.dsl.DSLContentModelAction<FTPWrapper>
      Throws:
      Exception
    • createFile

      public FTPWrapper createFile(org.alfresco.utility.model.FileModel fileModel) throws Exception
      Specified by:
      createFile in interface org.alfresco.utility.dsl.DSLFile<FTPWrapper>
      Throws:
      Exception
    • createFile

      public FTPWrapper createFile(org.alfresco.utility.model.FileModel fileModel, int fileSize) throws Exception
      Throws:
      Exception
    • createOfficeFile

      public FTPWrapper createOfficeFile(org.alfresco.utility.model.FileModel fileModel) throws Exception
      Create Office file which will be used in Integration tests by AOS
      Parameters:
      fileModel -
      Returns:
      Throws:
      Exception
    • uploadFile

      public FTPWrapper uploadFile(String pathToFile) throws Exception
      Upload file from disk via FTP protocol
      Parameters:
      pathToFile -
      Returns:
      Throws:
      Exception
    • uploadFile

      public FTPWrapper uploadFile(File file) throws Exception
      Upload file from disk via FTP protocol
      Parameters:
      file - File
      Returns:
      Throws:
      Exception
    • withJMX

      public JmxUtil withJMX()
      Returns:
      JMX DSL for this wrapper
    • withFtpUtil

      public FTPUtil withFtpUtil()
    • assertThat

      public FTPAssertion assertThat()
      Overrides:
      assertThat in class org.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.TestConfigurationException
      Exception
    • 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

      public String getModificationTime() throws Exception
      Get modification time of last resource
      Returns:
      Throws:
      Exception