Examples of FtpFileHandler


Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

    File theFile = new File("test1234567890.txt");
    FTPEpr ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());

    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      handler.deleteFile(theFile);
    }
    catch (CourierException ex)
    {
      // TODO should really look for false being returned to indicate no such file!
    }
View Full Code Here

Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

    else
      ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
     
    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      File[] files = handler.getFileList();
     
      System.err.print("Received information on ");
     
      if (files != null)
        System.err.println(files.length+" files");
View Full Code Here

Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

    else
      ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());

    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      File[] files = handler.getFileList();
     
      if ((files != null) && (files.length > 0))
      {
        System.err.println("Getting file "+files[0]);
       
        /*
         * This may return files within subdirectories. Unfortunately
         * the FTP Courier doesn't cope with them. At least it now
         * ignores them safely.
         */
       
        byte[] contents = handler.getFileContents(files[0]);
       
        if (contents != null)
        {
          String theFile = new String(contents);
         
View Full Code Here

Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

  {
    FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");

    try
    {
      @SuppressWarnings("unused")
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
     
      Assert.fail();
    }
   
    ftpEpr = new FTPEpr("ftp://foo.bar");
   
    try
    {
      @SuppressWarnings("unused")
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
View Full Code Here

Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

    File theFile = new File("test.txt");
    FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");

    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      @SuppressWarnings("unused")
      byte[] content = handler.getFileContents(theFile);
    }
    catch (CourierException ex)
    {
      // good!!
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
     
      Assert.fail();
    }
 
    ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + ":9090");
   
    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      @SuppressWarnings("unused")
      byte[] content = handler.getFileContents(theFile);
    }
    catch (CourierException ex)
    {
      // good!!
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
     
      Assert.fail();
    }
   
    ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname());
   
    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      @SuppressWarnings("unused")
      byte[] content = handler.getFileContents(theFile);
    }
    catch (CourierException ex)
    {
      // good!!
    }
View Full Code Here

Examples of org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler

    else
      ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());

    try
    {
      FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
     
      @SuppressWarnings("unused")
      File[] files = handler.getFileList();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.