Coding a FTP-client with a special feature

Hi!
I have a project in school where we are supposed to pick our own project that we code in java, and it has to be involved around networking. So I thought to myself that I should try to code a basic ftp client. This I don't see as a problem since there are a nice API for this, but there is however a glitch that I'm currently researching.
The special feature in my client is segment downloading. Enabling this feature will let loose 3-4 threads that will connect with the original login/pass and split the desired file in 3-4 parts so they all can download it at the same time. Does anyone got hints how I can accomplish this little task of splitting a file?
Any help would be GREATLY appreciated!
//Frank

Thanks for trying to help me with this. I just found a little info that might be useful that seems to proove that it's not a server-side matter: http://www.codeproject.com/KB/IP/MyDownloader.aspx
A little down on that page you can find this:
"Downloads can be segmented because both HTTP and FTP protocols allow the client to specify the start position of the stream. First, MyDownloader performs a request to the server to discover the file size. After that, MyDownloader calculates the segment size as follows:
segment size = min( (file size / number of segments),
minimum allowed segment size )
With the segment size, MyDownloader creates another request specifying the start position of the stream. In this way, we can have multi-requests for the same files running in parallel using multi-threading techniques. This technique speeds up the transfer rate even more if you are using mirrors."
Gotta read up to see if there is a way to apply this thinking in java.

Similar Messages

  • FTP Client with symlink support

    Hi there!
    Which FTP client can handle symlinks AND UTF-8 on iOS 6-iPhone 5?
    Thanks

    Look at this:
    https://itunes.apple.com/app/ftp-sprite/id480523641?mt=8

  • Ftp client with "modified only to load" option

    is there ftp client which loads up to ftp only the files which were modified?

    Also this might be of some help: Old Toad's Tutorial #2 - Uploading only those published new or newly edited files when using a 3rd party FTP client.
    OT

  • AUTH TLS ftp client?

    I've made my pure-ftpd work properly (with a virtual user database and ssl/tls), but I haven't been able to find any proper ftp client for the unix platform
    the most important thing is AUTH TLS support!
    a gtk2 interface would be nice, but it's not mandatory...
    any tips?

    I'm not using any ftp client with tls currently but let me search...
    First this is a list and comparision of ftp clients with support for tls auth for all systems:
    http://www.ford-hutchinson.com/~fh-1-pf … tml#client
    These look promising:
    Kermit http://www.columbia.edu/kermit/ck80.html
    Ftp-tls (from Openbsd) http://www.runestig.com/osp.html
    Kasablanca (with gui but for kde) http://kasablanca.berlios.de/features.html
    Bsdftpd has cli ftps client http://bsdftpd-ssl.sc.ru/
    Secureftp (Java gui) http://www.glub.com/products/secureftp/
    Lftp (it should automatically recognize tls) http://lftp.yar.ru/
    Iglooftp (nice gtk2 gui, commercial? closed source?) http://www.iglooftp.com/unix/download.html
    Kftpgrabber (gui, kde) http://kftpgrabber.sourceforge.net/features.php
    Pftp + gui clients (ncurses, gtk, qt ?) http://pftp.sourceforge.net/index.html
    Tls wrapper (allows any ftp client to use tls) http://tlswrap.sunsite.dk/
    BTW it's also good to read pure-ftpd readme first :-)
    http://www.pureftpd.org/README.TLS (there is tested clients list)...
    Maybe there are more. List of ftp clients for linux:
    http://www.usinglinux.org/ftp/
    http://www.linuxsoft.cz/en/sw_list.php?id_kategory=9
    Maybe some of them support tls too.

  • Creative Cloud AS a FTP client

    My business has a MAC server.  We access it remotely via the internet as a FTP.  I want use creative cloud as a ftp client, so that the interface allows for the previewing of ai and PDF files similar to BRIDGE.  Unless anyone out there knows of an FTP client with a very SLICK gui that can do this job...  How would I set up creative cloud to access my FTP?

    Hi Benjamin,
    Creative Cloud doesn't support FTP sadly, so you'd have to figure out a workflow using a browser to get the previews. I'm not aware of any FTP clients that would be able to generate these kinds of previews either.
    -Dave

  • FTP-Clients compatible with OES-PureFTPd - remote-home-feature

    Hi folks,
    I'm searching for Windows FTP Clients which are compatible with OES-FTP-Service (OES11SP1) and which support the remote-home feature. Until today I have only found filezilla (only in cygwin-Servertype configuration) which can handle a remote syntax like \\edir-servername to switch to another fileserver in the tree without any problems.
    Do you know any other ftp-clients for windows which support that remote-feature?
    Cheers, k.

    k-i-r,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://www.novell.com/support and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Forums Team
    http://forums.novell.com

  • Looking for a specific feature in an FTP Client

    Hello!
    I am looking for a "simple" feature in any FTP client for OS X.
    I have tried Fetch, Transmit, CyberDuck and Interarchy 7.x and none had the ability to throttle uploads/downloads. I work with a limited bandwidth and sometimes have to download files (or upload) in the background but at a very slow speed (because the peer has a poor connection).
    None of these nice (and they are nice!) ftp programs can do this. I have to either use wget via the command line (wget --limit-rate=xx) or use Total Commander for Windows inside a Parallels Virtual Machine.
    Does anybody know about a Mac FTP client that can throttle and enqueue items easily?
    Thanks in advance!

    Look at "lftp". It as about a zillion parameters that can be set. One of them is "net:limit-total-rate"
    Quoted from the Docs....
    limit transfer rate of all connections in sum. 0 means unlimited. You can specify two numbers separated by colon to limit download and upload rate separately. Note that sockets have receive buffers on them, this can lead to network link load higher than this rate limit just after transfer beginning. You can try to set net:socket-buffer to relatively small value to avoid this.
    Find lftp here lftp.yar.ru It is also in thr Fink archive. http://fink.sourceforge.net/

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

  • Connect to FTP site with Apache commons net FTP client through Proxy

    Hello,
    I am trying to run this simple code to connect to FTP site through a proxy.
    import org.apache.commons.net.ftp.FTP;
    import org.apache.commons.net.ftp.FTPClient;
    public class MyTest {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    System.setProperty("socksProxyHost" ,"10.148.0.131");
    System.setProperty("socksProxyPort", "1080");
    FTPClient ftpClient = new FTPClient();
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    boolean successLogin = ftpClient.login(ftpUserName, ftpPassword);
    if(successLogin)
    System.out.println("success login");
    else
    System.out.println("fail login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("loging out");
    ftpClient.logout();
    System.out.println("disconecting");
    ftpClient.disconnect();
    catch (Exception e) {
    e.printStackTrace();
    I am getting the following error:
    C:\temp\ftp\test>java.exe -cp ./commons-net-ftp-2.0.jar;. MyTest connecting
    java.net.SocketException: Malformed reply from SOCKS server
    at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
    at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:265)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:437)
    at java.net.Socket.connect(Socket.java:519)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:176)
    at MyTest.main(MyTest.java:23)
    loging out
    java.lang.NullPointerException
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:471<ftp://FTP.java:471>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534<ftp://FTP.java:534>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:583<ftp://FTP.java:583>)
    at org.apache.commons.net.ftp.FTP.quit(FTP.java:794<ftp://FTP.java:794>)
    at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:697)
    at MyTest.main(MyTest.java:39)
    I am able to do this using a different FTP client library, ftp4j-1.5.1<ftp://ftp4j-1.5.1> using the following code:
    import it.sauronsoftware.ftp4j.FTPClient;
    import it.sauronsoftware.ftp4j.connectors.SOCKS4Connector;
    public class MyTestFtp4J {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    FTPClient ftpClient = new FTPClient();
    ftpClient.setConnector(new SOCKS4Connector("10.148.0.131", 1080));
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    ftpClient.login(ftpUserName, ftpPassword);
    System.out.println("success login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("disconecting");
    ftpClient.disconnect(true);
    catch (Exception e) {
    e.printStackTrace();
    So I know the proxy settings are correct.
    The java version I used to compile and run my apps is 1.6.0_06 Does anyone can help figure out what is wrong when I use the Apache commons net FTP client?
    Thank you
    Jon

    Is the old AirPort Extreme base station (AEBS)
    configured so that the option to distribute IP
    addresses is DISABLED? If so, configure the new AEBS
    to act as a bridge.
    Are you suggesting I use a set-up with TWO AEBSs? Set up a bridge (not sure how) and then use the old AEBS to connect to the DSL modem and broadcast to the new Extreme which will then be the router to the other computers on the network?
    Do you have any port mapping or default host enabled
    on the old AEBS?
    I do not understand, not do I see these options in the Base Station utitlity; perhaps they are in the FTP options--but that, I'm sorry to say, is not obvious to my inspection.
    Duane, can you give me a few more basic instructions? Thanks
    iMac 17    

  • Impossible Upload files with Filezilla FTP Client after upgrade win8 to win8.1

    Hi
    Things were working fine with win 8 but, after Upgrade to win 8.1 is not possible upload files with Filezilla  FTP Client.
    is there anyone facing same problem?
    thanks in advance for any answer to help me solve this issue 
    Regards 
    TC

    Hi,
    Please Change your transfer settings in site manager from either default or passive to active it to see what's going on.
    Also, check IE compatibility mode.
    In addition, I suggest you install all latest updates for Windows since these updates will improve and fix some known issues.
    Kate Li
    TechNet Community Support

  • Cannot configure wrt54gs v6 router for use with filezilla FTP client

    I am new to working with FTP and very rusty on networking in general.  I just downloaded filezilla to create a FTP client on my desktop.  When I run their wizard, it says the connection is tainted by my router.  All the forums for filezilla say I need to configure my router to allow traffic on either port 21 (ftp) or a range of ports ( they suggest 50000 to 50100).
    Please let me know what I need to do to make this work
    thanks in advance
    ldygunner

    To answer your other questions, the tutorials have it all wrong. What they really need to explain, but fail to do so, is that the only situation where a FTP client would need to use active mode (the PORT command) is where the FTP server can't accept inbound connections on arbitrary port numbers. But that's a pathological case anyway: the FTP server can always accept connections on some well defined set of port numbers, to keep its own local firewall or NAT router happy. Consequently, there is really no need at all for a FTP client system to open up any ports to support active mode, rather than always operate in passive mode (as browsers do.)
    The fact of the matter is that if passive mode works in a browser for you, it will work for Filezilla also.
    And the configuration tests it runs are brain damaged. Even though the wizard recommends passive mode, it never tests for it. And it doesn't really test active mode either. What it really tests is whether anything between the client and the server is "transparently" translating IP addresses and port numbers. Such a test is broken, because the mere fact of port numbers being rewritten in TCP packets is irrelevant to whether PORT (active mode) will succeed or fail.
    For completeness, in case someone decides to get pedantic, there is a case where a FTP client system would need the active mode PORT command to work, but that case is now of historical interest only. It's a scenario that FTP servers no longer support, for security reasons. (What is it? When the FTP client is operating as a controller to remotely transfer files between two servers: it tells one server to use passive mode, and sends the address/port it gets to the other server in active mode, which in theory would make the second server open a connection to the first. This, in fact, is why two modes, active and passive, were originally defined in the FTP standard!)  And it still wouldn't need open ports on the client system.
    Message Edited by arayq2 on 10-19-2008 09:12 PM

  • FTP issues with DW CS5 that don't happen with an FTP client or MX

    On a mac OS 10.6.4, using DW CS5 to login to an existing site using FTP.  It connects fine but then all I get is a .txt file with a note indicating that FTP can't be used when Frontpage extensions are activated. I checked on my webserver status (at 1&1) and they aren't active. So I tried with an FTP client like cyberduck and all the files are there. Likewise, I used an old version of DW (think it was MX vintage 2002) and all the files show up server side just fine - (I just can't download the site due to version incompatibility so DW rejects it). Does anyone know what could be going wrong here? As far as I know the site was created by DWMX (think that was 2004). Thanks

    I assumed that if I was using an older version of DW then it wouldn't download pages authored with a later version but I guess it's just code...
    Yep - it's just text files containing HTML, CSS, javascript, and links to other files.
    When using FTP through DWMX I see the server side of the site
    You can see the files listed on the remote server?
    I can send you the details if you wish, I'm not sure what's going on here...
    You can try sending to forums at domain dot com (replace 'domain' with 'great-web-sights')

  • Issue with vlc steaming through dolphin ftp client

    I am not sure if i should post this here or in the multimedia section excuse me if i am mistaken. I have been using archlinux in almost 4 weeks with gnome 3. I have installed kde today after removing gnome(pacman -Rscn gnome). I have a small home server running ftp server where i have some media files(.mkv). In gnome i usually used nautilus to access the ftp folder(sftp://servername.dyndns.org/srv/) and run vlc to stream the medias. Tried to do the same with kde dolphin with no luck.
    First i was not able to view the folder with dolphin. I researched abd found this thread with a solution:
    http://forum.kde.org/viewtopic.php?f=18 … 5&start=15
    Now i am able to access the folder, but can't stream any media using vlc.
    The following errors are from vlc:
    Your input can't be opened:
    VLC is unable to open the MRL.
    sftp://servername.dyndns.org/srv/filename.mkv
    Check the log for details.
    Going into tools->messages gives the followings:
    main error: open of
    sftp://servername.dyndns.org/srv/filename.mkv failed:(null)
    I suspect something is wrong the ftp client configuration in dolphin. This bug report also bothers me also :
    http://old.nabble.com/-Bug-274170--New% … 05158.html
    Other thing is that i am able to open the media files using other media players(dragon player, mplayer), but then the files are automatically downloaded into the local folder /var/tmp/kdecache-username/krun/filename.mkv. The media player then loads the file from there. Its the same if i open a text file in the server, edit it and save it. Its first downloaded to the /var/ folder then asked to upload back to the server when closed.
    Its my conclusion that the ftp client in dolphin does not work properly or KDE KIO works different then whatever is used in gnome/nautilus. I hope i have explained the issue as good as possible and would appreciate any help or lead to how to solve this.

    Thanks for your reply, after checking some ideas I found that to get the ftp to work I needed to use the internal IP 10.0.0.1 for it rather than the old normal IP like before the firewall(probably a very beginner error sorry for that). And I discovered the exact issue causing clients to not see their characters if not using Hamachi.
    Hamachi treats everyone join to the network as though they are local I believe, so when the server send character info via Hamachi it thinks it is sending the info locally and then Hamachi itself sends it out to the extrenal client, while tracing the data I found that the login process sends a 33 byte packet of data to the client via TCP from port 5051 out to the client on a rnadom port usually in the range of 40000-50000 telling the client to send a request to the other process to ask for the character information.
    Now for some reason I see when a client logs in through Hamachi that packet is sent correctly to their Hamachi IP and recived fine.(sent from 10.0.0.1:5051 to the Hamachi IP:40k-50k) but when a client tries to log in using a normal IP with Hamachi turned off, the log in process does send the 33 byte packet from 10.0.0.1:5051 to the client WAN IP through the usual port but the client never recieves this packet and as such doesn't not request the character information.
    So my guess is something on the 5505 is disallowing the log in process to send the data externally to the clients WAN IP's? Though this is very odd because it does allow the client to actually log in to the account and seems to recieve at least part of that information fine.
    If any help that might resolve this for me can be given I would very much appreciate it, this issue is limiting my client base and as such my income and business as a whole. Thank you in advance for any help given.

  • Help with my FTP client program

    Hello All,
    I am trying to modify a client FTP program to get a grasp on network programming. However when I try to connect to the host I get an error of Anonyymous login. What am I doing wrong? Below is the FTPclass program that I found on the net. How do resolve this issue? Thanks!!
          * Connects to the given FTP host on port 21, the default FTP port.
    //     public boolean connect(String host, int port, String userName, String passWord) throws UnknownHostException,
    //               IOException {
    //          return connect(host, 21, userName, passWord);
          * Connects to the given FTP host on the given port.
         public boolean connect(String host, int port, String userName, String passWord) throws UnknownHostException,
                   IOException {
              connectionSocket = new Socket(host, port);
              outputStream = new PrintStream(connectionSocket.getOutputStream());
              inputStream = new BufferedReader(new InputStreamReader(connectionSocket
                        .getInputStream()));
              if (!isPositiveCompleteResponse(getServerReply())) {
                   disconnect();
                   return false;
              return true;
          * Disconnects from the host to which we are currently connected.
         public void disconnect() {
              if (outputStream != null) {
                   try {
                        if (loggedIn) {
                             logout();
                        outputStream.close();
                        inputStream.close();
                        connectionSocket.close();
                   } catch (IOException e) {
                   outputStream = null;
                   inputStream = null;
                   connectionSocket = null;
          * Wrapper for the commands <code>user [username]</code> and <code>pass
          * [password]</code>.
         public boolean login(String username, String password) throws IOException {
              int response = executeCommand("user " + username);
              if (!isPositiveIntermediateResponse(response))
                   return false;
              response = executeCommand("pass " + password);
              loggedIn = isPositiveCompleteResponse(response);
              return loggedIn;
          * Added by Julian: Logout before you disconnect (this is good form).
         public boolean logout() throws IOException {
              int response = executeCommand("quit");
              loggedIn = !isPositiveCompleteResponse(response);
              return !loggedIn;
          * Wrapper for the command <code>cwd [directory]</code>.
         public boolean changeDirectory(String directory) throws IOException {
              int response = executeCommand("cwd " + directory);
              return isPositiveCompleteResponse(response);
          * Wrapper for the commands <code>rnfr [oldName]</code> and <code>rnto
          * [newName]</code>.
         public boolean renameFile(String oldName, String newName)
                   throws IOException {
              int response = executeCommand("rnfr " + oldName);
              if (!isPositiveIntermediateResponse(response))
                   return false;
              response = executeCommand("rnto " + newName);
              return isPositiveCompleteResponse(response);
         /**Here is the code to test the client program
    lass verifyFTP {
         public static void main(String[] args) {
              String serverName;
              String portNumber;
              int port = 21;
              FTPConnection ftp = null;
              try {
                   if (args.length == 0) {
                        serverName = getStringFromUser("Enter the server you would like to connect to: ");
                        if (serverName.length() == 0) {
                             return;
                        }//end if
                   } else {
                        serverName = args[0];
                   }//end else
                   String userName = "";
                   String passWord = "";
                   // set the FTPConnection parameter to true if you want to
                   // see debug output in your console window
                   ftp = new FTPConnection(true);
                   System.out.println("Attempting to connect to " + serverName);
                   ftp.connect(serverName, port, userName, passWord);
                   if(ftp.login("", "")){
                        System.out.println("Successfully logged in!");
                        System.out.println("System type is: " + ftp.getSystemType());
                        System.out.println("Current directory is: "
                                  + ftp.getCurrentDirectory());
                        String files = ftp.listFiles();
                        // private function that gets console input from the user
         private static String getStringFromUser(String prompt) throws IOException {
              System.out.print(prompt);
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              return br.readLine();

    You should print out exactly what you are sending and what you are recieving via the socket. You do this just before you send it and when you receive it (you do not modify it in any way first.)
    You should also use an existing FTP client to log into your server. Presumably it is successful. Then you can use ethereal (free software google it) to examine exactly what the FTP client sends versus what you are sending. You will probably find that it is sending a different command than what you are.

  • Alternative FTP client app on mac

    Hi guys
    Can you recommend on a good reliable FTP client for Mac? I would like the FTP client to upload files automatically upon saving the file which is a great feature of Espresso but unfortunately I find Espresso's FTP to be a pain to work with.
    Thanks

    If you check the following article, you will get a list of FTP clients recommended by Business Catalyst
    http://kb.worldsecuresystems.com/kb/connecting-your-site-using-ftp.html#main_Understanding _FTP_clients
    Here is the List of FTP clients for MAC given in the Article:
    http://www.cuteftp.com/trial.aspx (Cute FTP)
    http://filezilla-project.org/download.php (File Zilla)
    http://cyberduck.ch/ (Cyberduck)
    http://mac.sofotex.com/download-130101.html (SimpleFTP)
    Hope this helps.

Maybe you are looking for

  • How to trap warning messages generated from the background processing?

    Hi all, Following is my requirement, i want to know whether it can be done and how? The credit management (CM) warning messages generated as a result of the CM background processes, where do the messages go? Can you trap them and include them in an i

  • Help collection not available except in English

    Hello ,  The Help button is only available when the user has configured his locals in en-us (1033). Multi-language is activated, , language pack are on the server.  On bellow, you can see the Regional and Language configuration for the site  URL for

  • Does anyone know anything about Afterthemac G54 Wireless Card

    I am interested in setting up a wireless network. I have an IMAC 800mhz. I am on a limited budget. I found the G54 Wireless Card from Afterthemac.com. Does anyone know if it works esp since it's a USB device? imac 800mhz   Mac OS X (10.3.2)  

  • TopLink ADF Faces Tutorial - Object Generation Error

    Hi, I'm trying to work through the tutorial "Build a Web Application with ADF Faces and Oracle TopLink" (http://www.oracle.com/technology/obe/obe1013jdev/masterdetailedit_adftoplink/endtoend_toplink_adffaces.htm#t2), but I am stuck at the last step o

  • Iteration problem in script.

    Hi Experts,    I have one Main window , footer window and logo windows in my script.But eventhough the WRITE FORMS are in same loop, in the first iteraion it is going only to the main window .So the first page Footer contains the second iteration val