Help with apache ftp

Hi all
I am using the apache FTPClient to ftp files around. My problem is that I seem to be able to only send / retrieve 1 file before I need to reset the whole connection. I think that the answer may lie with this method
http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html#setRestartOffset(long)
... that's what I need, right? A restart offset, I think. How do I do it?
Does anyone have any experience with this package, or with programmatic FTP?

i figured this out.

Similar Messages

  • Need Urgent Help with Apache and PHP

    I have been struggling with apache and php for a week now and I finally broke down to post a message.
    I have apache 1.3 running on my mac mini g4 with 10.4.9 and I installed sql. I went to the entropy website and downloaded php5 to install without knowing I already had php4 on the machine. I installed 5 but could not get it to work. I then went back to httpd.conf and tried to install php4 by uncommenting out the loadmodule and addmodule lines. I restarted apache but php still did not work. I tested the phpinfo.php script but all I got was the script in Safari and not the actual page. At the moment, I have php4 and php5 on my machine but can't get either one to work. I am sure there is an easy fix but I don't know it. Please help.

    The problem is not terribly complicated, but Apache will not start with the entropy file in the folder
    /etc/httpd/users/
    Let me experiment on you. Rename the entropy file and then try to start Apache. To do this, open Terminal and paste this command:
    <pre>sudo mv /etc/httpd/users/+entropy.conf /etc/httpd/users/+entropy<pre>
    Now check the Apache configuration:
    <pre>apachectl configtest<pre>
    If it says "Syntax OK", start Apache:
    <pre>sudo apachectl start<pre>
    Since we only disabled the entropy file, you should be able to enable PHP5 with some more advanced configuring.

  • Help with ESB - FTP Inbound Adaptor - using SFTP

    I am a newbie to ESB. I need to get files from an SFTP server machine and route them to a local file.
    I have created an ESB project in JDeveloper with an Inbound FTP adaptor, a router and an outbound file adaptor. I then registered it with the ESB server.
    Following the instructions in the "Oracle Application Server Adaptor for Files/FTP" manual, I setup a connector factory with the (I think) necessary properties to connect to the SFTP server in the Oracle_Home\j2ee\home\application-deployments\default\FtpAdaptor\oc4j-ra.xml file. I also installed the cygwin/openssh according to the instructions though I am not sure I need it for gets.
    Problem is that nothing is happening. It doesn't pull down any files from the SFTP server. I can connect using FileZilla (an interactive SFTP Client) to the SFTP server and see the directory where the files are and have setup the FTP Adaptor to poll that directory and filenames. In the ESB control I see no instances get created.
    I don't know how to debug this. In the Enterprise Manager I can test the router and the file output services but I cannot find (and therefore cannot test) any service for the inbound FTP adaptor.
    I would appreciate any help or insight anyone has! Thanks! Nick

    Sorry for the double post. First time I tried it hung after I clicked on Post Message so I assumed it didn't actually post so I stopped and posted again.
    Nick

  • Need help with Apache on OS X Server 10.4.8

    I am unable to get mod_rewrite to work... Additionaly, bonjour is not working at all.
    I am wondering if there are any known issues (that I could not find) and/or helpful solutions. I was considering doing a recompile based on the instructions found at http://lists.apple.com/archives/macos-x-server/2005/Apr/msg01171.html
    I am not sure if these instructions are valide for the 10.4.8 environment... os if anyone knows fore-sure please do let me know.

    Sorry, I thought the goal was to get the RewriteRules working - recompiling Apache seemed like the harder approach to me (with no chance of it working if the flaw was in the RewriteRule statement itself )
    That said, the instructions you reference will probably work. As will downloading the source from apache.org and running their standard build. It won't be the same as the build as shipped by Apple, though.
    The issue is that everyone's instructions on how to build apache (including the one you reference) suits a particular individual's needs/expectations of what s/he wants. In this case they wanted SSL, but you might or might not want/need that. You might need other modules they didn't include, though, so there's no guarantee their build will work for you.
    In any case you're not going to get the custom Apple modules including 'apple_auth', 'apple_spotlight', 'hfs_apple' or 'spnego_apple'. These are developed by Apple and included in their build but are not part of the standard Apache distribution. You might find the source for them in the Darwin source but I've never looked.
    So, in summary, there are so many ways to build apache, with so many combinations of features and modules, it's impossible to say whether that'll work for you since everyone's situation is different.

  • Help with Apache plugin for Tomcat

    I downloaded jakarta-tomcat-connectors-jk2-src-current.tar.gz from apache.org. I am trying to install this without any progress. The web page http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html gives lots of info on how to install the plug in called JK. I believe the unix section applies to linux as well. Can anyone help me with this? Please copy your message if at all possible to [email protected] Thanks Murthy

    I know what mod_jk is, I was just trying to understand your situation.
    You have two choices, mod_jk and mod_jk2 with different configurations files.
    In both cases, you need 3 parts:
    1- apache
    2- the mod_jk(2) module (.so) for your apache version (1.3.x or 2.x)
    3- tomcat
    You obviously have 1 and 3, and probably 2 also.
    Config is twofold:
    1) In httpd.conf (Apache 2.0) you need:LoadModule jk2_module modules/mod_jk2.so
    <IfModule mod_jk2.c>
      JkSet config:file "/path/to/workers2.properties"
    </IfModule>
    # And for each context:
       <Location "/contextname/*">
          JkUriSet worker ajp13:localhost:8001
       </Location>2) workers2.properties:[logger]
    level=WARN
    #INFO
    #/web_ci/
    [config:]
    file=/path/to/workers2.properties
    debug=0
    debugEnv=0
    [uriMap:]
    info=Maps the requests. Options: debug
    debug=0
    # Alternate file logger
    [logger.file:0]
    level=WARN
    file=/path/to/logs/jk2.log
    # Cache for activity
    # Must point to a writeable path
    [shm:]
    info=Scoreboard. Required for reconfiguration and status with multiprocess servers
    file=/path/to/jk2.shm
    size=1000000
    debug=0
    disabled=0
    [workerEnv:]
    info=Global server options
    timing=1
    debug=99
    # Default Native Logger (apache2 or win32 )
    # can be overriden to a file logger, useful
    # when tracing win32 related issues
    logger=logger.file:0
    # Communication channel to use
    [channel.socket:localhost:8001]
    info=Ajp13 forwarding over socket
    debug=0
    tomcatId=localhost:8001
    # Connector as in conf/server.xml
    [ajp13:localhost:8001]
    channel=channel.socket:localhost:8001
    # Tomcat load balancing
    [lb:lb]
    info=Default load balancer.
    debug=0
    [status:status]
    info=Status worker, displays runtime informations
    # Monitor for requests and config http://server:port/jkstatus
    [uri:/jkstatus/*]
    info=Display status information and checks the config file for changes.
    group=status:status3) Finally, you need to set the connector (port number) in server.xml    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8001 -->
        <Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
                   port="8001" minProcessors="5" maxProcessors="75"
                   enableLookups="true" redirectPort="8443"
                   acceptCount="10" debug="3" connectionTimeout="2000"
                   useURIValidationHack="false"
                   protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>This is the setup I use on Win2K, but should work pretty much the same on Linux. I also have a similar setup on Linux, but with mod_jk instead of mod_jk2.
    Hope this helps!

  • Help with apache!!!

    I can't get my apache server to work, it was working fine until i started messing around with openssl and now i can't activate web sharing under system preferences. I did sudo apachectl configtest and i get this error.
    httpd: Could not reliably determine the server's fully qualified domain name, using Gabriels-MacBook-Pro.local for ServerName
    I can provide the httpd.conf files if anyone needs them.
    Help please!!

    Okay if you are looking for the jar files to compile Servlets and JSP they are under the common/lib folder of your tomcat installation. You sill probably only need the servlet-api.jar file.
    I recommend that you read the online documentation that comes with tomcat and look at all the of the examples before trying to code something.

  • Newbie help with apache xmlrpc

    greetings everybody,
    i'm new to xml-rpc and i'm using the apache xmlrpc implemtation. I would just would like to ask if theres a way to add /edit headers of to my XmlRpcClient request. I know how to deal with the other headers like Content-Length and Authentication etc. but i need to add a "User Agent" header. Can u guys help me on this problem... tnx in advanced! :)

    Okay if you are looking for the jar files to compile Servlets and JSP they are under the common/lib folder of your tomcat installation. You sill probably only need the servlet-api.jar file.
    I recommend that you read the online documentation that comes with tomcat and look at all the of the examples before trying to code something.

  • Need help with Apache-WL 5.1 config

    I have an WL application which is invoked anytime a url that starts
    with /app. This is configured as follows:
    <Location /app>
    SetHandler weblogic-handler
    </Location>
    What my customers now want is to create new urls which will invoke my
    application. For example, one customer wants the following url:
    /airline/atlanta
    Which will need to map to the following url:
    /app/URLServlet/airline/atlanta
    I have tried to create a "RewriteRule", but found that apache looked
    for the result in the docroot instead of transferring it to WL.
    The following shows my "Rewrite config":
    RewriteEngine on
    RewriteLog "/var/apache/logs/rewrites"
    RewriteLogLevel 3
    RewriteRule ^/airline/atlanta /app/URLServlet$1
    WebLogicHost rome
    WebLogicPort 7101
    <Location /app>
    SetHandler weblogic-handler
    </Location>
    The following is from the rewrite log file:
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2) init
    rewrite engine with requested uri /airline/atlanta
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (3)
    applying pattern '^/airline/atlanta' to uri '/airline/atlanta'
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2)
    rewrite /airline/atlanta -> /app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2) local
    path result: /app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2)
    prefixed with document_root to /var/apache/htdocs/app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (1)
    go-ahead with /var/apache/htdocs/app/URLServlet$1 [OK]
    And of course, there is no such thing in the docroot.
    Any thoughts? Please help.
    [bryon.vcf]

    I have a similar problem. Does anyone out there know how Apache URL
    rewriting interacts with mod_wl?
    My situation is that I want to pass a piece of information (which virtual
    host the request came in on) to weblogic. It appears that RewriteRule with
    the [QSA] option is perfect for this, except that for some reason the
    servlet request reports the original URL, not the rewritten one. I put in a
    rule that says
    RewriteRule ^(.*jsp)$ $1?VHOST=mydomain.com [QSA]
    and the rewrite log shows that the rule is applied, but
    HttpServletRequest.getQueryString() still returns null.
    Has anyone passed any information like this from Apache to Weblogic?
    Thanks,
    Greg Abbas
    "Bryon G. Rigg" wrote:
    I have an WL application which is invoked anytime a url that starts
    with /app. This is configured as follows:
    <Location /app>
    SetHandler weblogic-handler
    </Location>
    What my customers now want is to create new urls which will invoke my
    application. For example, one customer wants the following url:
    /airline/atlanta
    Which will need to map to the following url:
    /app/URLServlet/airline/atlanta
    I have tried to create a "RewriteRule", but found that apache looked
    for the result in the docroot instead of transferring it to WL.
    The following shows my "Rewrite config":
    RewriteEngine on
    RewriteLog "/var/apache/logs/rewrites"
    RewriteLogLevel 3
    RewriteRule ^/airline/atlanta /app/URLServlet$1
    WebLogicHost rome
    WebLogicPort 7101
    <Location /app>
    SetHandler weblogic-handler
    </Location>
    The following is from the rewrite log file:
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2) init
    rewrite engine with requested uri /airline/atlanta
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (3)
    applying pattern '^/airline/atlanta' to uri '/airline/atlanta'
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2)
    rewrite /airline/atlanta -> /app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2) local
    path result: /app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (2)
    prefixed with document_root to /var/apache/htdocs/app/URLServlet$1
    172.16.1.108 - - [12/Dec/2000:18:11:42 -0500]
    [atlanta.atl.globaleventures.com/sid#757d0][rid#b7938/initial] (1)
    go-ahead with /var/apache/htdocs/app/URLServlet$1 [OK]
    And of course, there is no such thing in the docroot.
    Any thoughts? Please help.--
    Greg Abbas
    [email protected]
    http://www.abbas.org

  • Need help with Apache self signed client certificates.

    At work we use PHPmyadmin to administer our central MySQL database.
    In order to access PHPmyadmin we use self signed ssl client certificates, for our developers, so that you can only access phpmyadmin if you have a valid client certificate installed in your browser.
    The ssl certificate on the webserver hosting phpmyadmin has expired now and I would like to extend it, preferrably without having to re-genereate client certificates for all users.
    I'm a bit confused to the approach. Most howtos I've found deal with extending a webserver certificate. but it really just looks like they generate a new one.
    Can anyone help me out with how best to approach this.
    Do I simply generate a new Apache Server certificate and then use this to re-sign the existing client certificates?

    As the SOAP servlet says: "Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me.", you must use the HTTP POST method and not the GET method to use SOAP.
    Use setRequestMethod("POST") of class HttpURLConnection to make your HTTP connection use the POST method.
    (I didn't look at all your code).
    Jesper

  • Need some help with Apache vhost. Access a server on network.

    Not sure if this can be done. But here is my case:
    Me and my colleague is writing some database applications for out employer. And this server runs Apache, PHP and MySQL.
    We want to be able to access different vhosts using just the post after the server local IP-address. (I.e., 10.0.2.242:8080).
    Because we want to use the same server for different projects, but we need some way to split this. And so far, a port name is the best.
    Another way would be to use the DNS server, and redirect any request for example.com to that particular server. but since we have started to use OpenDNS, that can't be done.
    My question is, can't this be achived? If I type 10.0.2.242:8080, i can be directed to /srv/http/test_vhost, where /srv/http is the server root.
    Any reply is much apprecited. Since I could find an answear on Google.
    Birger

    MindTooth wrote:I run Windows at work. But I think I know to set a hosts different.
    IIRC, C:\Windows\System32\drivers\etc\hosts
    MindTooth wrote:(OpenDNS sucks because? Better then the DNS server located inhouse. It is slooooow. OpenDNS is faster.)
    It can screw you up because it *always* returns an IP address, which isn't so bad for web browsing, but when you're trying to do (or diagnose!) other things it can really screw with you.
    MindTooth wrote:I have tryed it. But when I added :8080 behind the IP, it would not direct to the correct folder.
    Have you uncommented this line in httpd.conf?
    #Include conf/extra/httpd-vhosts.conf

  • Help with Apache plugin for WebLogic on HP-UX

    Hi,
    I am trying to get Weblogic 5.1(w/sp8) on HP-UX 11 talking to Apache 1.3.19.21(port
    8080) also on HP-UX 11 ( both on same box ). I have WebLogic listening on port
    9001, and I followed the instructions to configure apache and weblogic. However
    when I do http://mymachine:8080/weblogic/portal/hello.jsp. I get unable to find
    page.
    weblogic is installed in /weblogic. The hello.jsp is located in /weblogic/myserver/public_html/portal/hello.jsp.
    Apache is installed in /opt/apache.
    The Apache httpd.conf file contains the following:
    <Location /weblogic>
    SetHandler weblogic-handler
    PathTrim /weblogic
    WebLogicHost localhost
    WebLogicPort 9001
    </Location>
    What am I missing ? The error_log for Apache shows the following:
    [Mon Nov 12 11:21:09 2001] [warn] Loaded DSO libexec/mod_wl.so uses plain Apache
    1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
    [Mon Nov 12 11:21:10 2001] [notice] Apache/1.3.19 (Unix) PHP/4.0.4pl1 configured
    -- resuming normal operations
    [Mon Nov 12 11:21:32 2001] [notice] child pid 13248 exit signal Segmentation fau
    lt (11)

    Well... there is a warning in the log file saying that it might crash - and then
    it crashes. Check that you are running a supported platform, if you are, contact
    BEA Support.
    I would discourage the use of forwarding to 'localhost'.
    Mike
    "Niranjan Perera" mckesson.com wrote:
    >
    Hi,
    I am trying to get Weblogic 5.1(w/sp8) on HP-UX 11 talking to Apache
    1.3.19.21(port
    8080) also on HP-UX 11 ( both on same box ). I have WebLogic listening
    on port
    9001, and I followed the instructions to configure apache and weblogic.
    However
    when I do http://mymachine:8080/weblogic/portal/hello.jsp. I get unable
    to find
    page.
    weblogic is installed in /weblogic. The hello.jsp is located in /weblogic/myserver/public_html/portal/hello.jsp.
    Apache is installed in /opt/apache.
    The Apache httpd.conf file contains the following:
    <Location /weblogic>
    SetHandler weblogic-handler
    PathTrim /weblogic
    WebLogicHost localhost
    WebLogicPort 9001
    </Location>
    What am I missing ? The error_log for Apache shows the following:
    [Mon Nov 12 11:21:09 2001] [warn] Loaded DSO libexec/mod_wl.so uses plain
    Apache
    1.3 API, this module might crash under EAPI! (please recompile it with
    -DEAPI)
    [Mon Nov 12 11:21:10 2001] [notice] Apache/1.3.19 (Unix) PHP/4.0.4pl1
    configured
    -- resuming normal operations
    [Mon Nov 12 11:21:32 2001] [notice] child pid 13248 exit signal Segmentation
    fau
    lt (11)

  • Help with apache mod_perl

    I'm in the process of teaching myself perl, and I've also just set up a server. I'd like to combine my efforts .    I'd like to know how to set up apache with mod_perl. I gather it will probably need some sort of recompilation? I also don't see a mod_perl package anywhare. What will I have to do to set this up?
    I've been using linux for a while, and arch for most of the time, but I've never really played with this sort of thing before, so I'm kinda lost  :oops: .

    Dirty PKGBUILD, which doesn't work. Oh well, I'll repair it ASAp
    # $Id$
    pkgname=mod_perl
    pkgver=2.0
    pkgrel=1
    pkgdesc="The full power of the Perl programming language and the Apache HTTP server."
    url="http://perl.apache.org"
    depends=(apache perl)
    source=(mod_perl-2.0-current.tar.gz)
    md5sums=('3e7f7aefb19c772a998802990ced15c0')
    build() {
    cd $startdir/src/$pkgname-2.0.0-RC6
    perl Makefile.PL MP_APXS=`which apxs` PERLPREFIX=$startdir/pkg/usr SITEPREFIX=$startdir/pkg/usr
    make || return 1
    make install
    Maybe somebody will write tidier package. Take care. (Well, next would be embperl package).
    Ja ne,
    Antti

  • Help with Apache Reverse Proxy configuration with SAP Portal and SAP Webgui

    Dear Experts,
    I have an issue configuring Apache to work with SAP Portal and ERP webgui. Accessing Portal through Reverse Proxy is working fine. But the problem arises when we try to open an iView ERP webgui transaction page from Portal with the Reverse Proxy. Have anyone implemented similar requirements and could advice on the configuration required on the Apache side? Thank you

    hi,
    pls check the below links for reference:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/24396589-0a01-0010-3c8c-ab2e3acf6fe2
    searchsap.techtarget.com/searchSAP/downloads/chapter-december.pdf
    1)Learn to implement the reverse proxy filter and portal gateway in SAP Enterprise Portal 6.0 on Web Application Server 6.40.
    https:/.../irj/sdn/nw-portalandcollaboration?rid=/webcontent/uuid/006efe7b-1b73-2910-c4ae-f45aa408da5b
    .2 )Configuring the Portal for Your Reverse Proxy Filter Solution . ... This document describes the reverse proxy filter mechanism in SAP Enterprise ...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/32ad9b90-0201-0010-3c8a-c900cd685f8f
    3)have full reverse proxy functionality. Possibly. filter. requests. Internet ... Reverse proxy (optionally with authentication etc.) ...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c066c390-0201-0010-3cba-cd42dfbcc8be
    Note:please reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • Help with apache and virtual hosts

    I hope someone can help me I had installed shared point for testing and learning it. I had setup alternative mapping and know I want to add sub domain to my Apache web server. So I have sub domain redirecting back to share point. Also mine website is being redirected to share point. How I can have sub domain redirected to share point and main website go to my drupal ? I had created virtual host for main website but I still  get redirected to share point.

    I have this and the problem is that main domain goes to share point.
    <VirtualHost xxxx.us:80>
    ServerName xxxx.us
    ServerAlias www.xxxx.us
    DocumentRoot "/srv/http"
    ServerAdmin [email protected]
    ErrorLog "/var/log/httpd/error_log"
    CustomLog "/var/log/httpd/access_log" common
    <Directory />
    Options FollowSymLinks
    AddHandler cgi-script .cgi .pl
    Options ExecCGI Indexes FollowSymLinks MultiViews +Includes
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>
    </VirtualHost>
    <VirtualHost sharepoint.xxxx.us:80>
    ServerName sharepoint.xxxx.us
    ServerAlias sharepoint.xxxx.us
    DocumentRoot "/srv/http"
    ServerAdmin [email protected]
    ErrorLog "/var/log/httpd/error_log"
    CustomLog "/var/log/httpd/access_log" common
    RewriteEngine On
    RewriteLog "/var/log/httpd/rewrite_log"
    RewriteLogLevel 9
    RewriteCond %{HTTP_HOST} !^(sharepoint\.)?hebe\.us$
    RewriteRule ^(.*)$ http://hebe.us$1 [L,R=301]
    ProxyRequests On
    ProxyPreserveHost On
    ProxyVia full
    ProxyPass / http://192.168.0.38/
    ProxyPassReverse / http://192.168.0.38/
    </VirtualHost>
    Last edited by tritron4 (2013-06-19 17:01:08)

  • 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.

Maybe you are looking for