Menu

FTP Scanner

Help
Bob C
2005-03-08
2013-04-16
  • Bob C

    Bob C - 2005-03-08

    The FTP scanner does not run properly when I include either of the two following properties in config.properties:

    ftpOutFolder
    localBackupFolder

    Here are some error messages:

    <2005-03-08 16:25:41,890> ERROR [myftp] :  [ScannerWorker.process] Error scannin
    g...
    com.babeldoc.scanner.ScannerException: Error connecting to ftp
            at com.babeldoc.scanner.worker.FtpScanner.doScan(Unknown Source)
            at com.babeldoc.scanner.ScannerWorker.process(Unknown Source)
            at com.babeldoc.scanner.ScannerThread.run(Unknown Source)
    Caused by: com.babeldoc.scanner.ScannerException: Error connecting to ftp
            at com.babeldoc.scanner.worker.FtpScanner.processFtpFolder(Unknown Sourc
    e)
            ... 3 more
    Caused by: com.babeldoc.scanner.ScannerException: Message not available
            at com.babeldoc.scanner.worker.FtpScanner.processFile(Unknown Source)
            ... 4 more
    Caused by: java.lang.NullPointerException
            ... 5 more

    If I don't include either of the aforementioned properties, the ftp scanner is working fine for me.

    Thanks,
    Bob

     
    • Bob C

      Bob C - 2005-03-09

      This was happening because I did not specify the 'ftpFolder' property (because the files are being dropped in the root folder), so the 'ftpFolder' field ends up being null. Here is the line in FtpScanner where the exception occurs (in the processFile(String fileName) method)

      String localPath =
                          localBackupFolder + fileName.substring(ftpFolder.length());

      The files we are interested in are dropped in the root folder of our FTP site, so I slightly modified the initialize() method in FtpScanner:

      ftpFolder = this.getInfo().getStrValue(FTP_FOLDER);
      // my code
      if (ftpFolder == null) {
          ftpFolder = "";
      }

      Now we can process files without specifying the ftpFolder property

       
    • bruce mcdonald

      bruce mcdonald - 2005-03-11

      I will add this fix to CVS

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.