Package com.enterprisedt.net.ftp

Examples of com.enterprisedt.net.ftp.FTPFile


       
        // put to a random filename
        String filename = generateRandomFilename();
        ftp.put(localDataDir + localTextFile, filename);

        FTPFile ftpFile = ((FTPClient)ftp).fileDetails(filename);
       
        log.debug("[" + ftpFile.toString() +"]");
       
        ftp.delete(filename);
       
        ftp.quit();
    }
View Full Code Here


        tools.setUser("anonymous");
        tools.setPassword("test@test.com");

        connect();
               
        FTPFile ftpFile = ((FTPClient)ftp).fileDetails("index_renamed.html");
       
        log.debug("[" + ftpFile.toString() +"]");
               
        ftp.quit();
    }
View Full Code Here

                        x.printStackTrace();
                    }
                }
            }, "ftpfs_keepalive");
            thread.start();
            FTPFile f = new FTPFile("/", "/", 0, true, new Date(0));
            // FTPFile f = new FTPFile();
            // f.setName(printWorkingDirectory());
            root = new FTPFSDirectory(this, f);
            closed = false;
        } catch (Exception e) {
View Full Code Here

        System.out.println("TransferEdtftpj::list(), directory = '"+listDir+"'");
        //  Grab the contents of this directory
        FTPFile[] contents = m_ftp.dirDetails(listDir);

        for(int a=0;a<contents.length;a++){
          FTPFile file = contents[a];
          String name = file.getName();
         
          System.out.println("ftp list: name = "+name);
         
          //  Ignores any string which is null, or contains a "." or ".." in it
          if(name == null || name.endsWith(".")) continue;
         
          //  Chop off the first / so you can safely concatenate it to the directory
          if(name.startsWith("/")) name = name.substring(1);
         
          name = directory+name;
         
          //  Is it a directory or file? add it to the appropriate array
         
          /*
           *  There is a logic error with regard to recursing I think where this should
           *  be decided in the RemoteDirectory layer, not here, the problem is that I think
           *  this code will result in a list of files being created, but not the respective
           *  directories which exist, now, you should not recurse into those if it's disabled
           *  but you should create the basic entries anyway, but I dont think that happens at the
           *  moment.
           *
           */
          if(file.isDir() == true && m_details.getRecurse() == true){
            folders.add(name+"/");
          }else{
            files.add(name);
          }
        }
View Full Code Here

TOP

Related Classes of com.enterprisedt.net.ftp.FTPFile

Copyright © 2018 www.massapicom. 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.