Class WriteToFTP

java.lang.Object
com.ptc.windchill.esi.lite.tgt.webject.WriteToFile
com.ptc.windchill.esi.lite.tgt.webject.WriteToFTP

public class WriteToFTP extends WriteToFile
Implementation for Write-To-Ftp custom webject for ERPConnector.

Supported API: true
See Also:
  • Method Details

    • writeToFtp

      public static com.infoengine.object.factory.Task writeToFtp(com.infoengine.object.factory.Task task) throws IOException, com.infoengine.util.IEException, URISyntaxException, WTException
      Writes a file to the specified ftp location. Expects FILE_NAME, FTP_URL, FTP_MODE and CONTENT parameters to write the file. The FTP_MODE parameter specifies the mode for file transfer - 'A' or "ASCII" is for ASCII mode of transfer while 'I' is for binary mode of transfer. Optionally, XSL_URL, XSL_DBUSER, XSL_PASSWD, XSL_PARAM can be set for the webject if CONTENT needs to be transformed using XSL before writing the file at the location specified by the PATH parameter. The XSL_xxx parameters however are applicable only when sending the output in the ESI XML format.

      Supported API: true
      Parameters:
      task - The input Info*Engine task
      Returns:
      The resulting Info*Engine task
      Throws:
      com.infoengine.util.IEException
      IOException
      URISyntaxException
      WTException
    • upload

      protected static void upload(String ftpServer, String fileName, File sourceFile, String type) throws MalformedURLException, IOException
      Uses URL object to upload file to ftp client

      Supported API: true
      Parameters:
      ftpServer - the ftp server host
      fileName - A file name for uploading the file
      sourceFile - the source file that needs to be uploaded
      type - type of upload
      Throws:
      MalformedURLException
      IOException