Help on ftpClient

Hi there,
I am a Oracle Developer and I would request your help in using ftpClient. I am using following code for ftping files and then deleting them from the ftp server.
import java.io.*;
import oracle.sql.*;
import java.io.IOException;
import sun.net.TransferProtocolClient;
import sun.net.ftp.FtpClient;
import java.util.Enumeration;
import java.util.Vector;
import FullFtpClient;
public class ORIX_ftp
public static int fget
String host, //FTP server ip address or name
NUMBER port, //FTP server ftp port number
String username, //FTP server username
String password, //FTP server password
String transtype, //FTP transfer type "ASCII" or "BINARY"
String remotedir, //Remote or FTP server directory path from where files will be fetched
String localdir, //Local or Oracle server directory path where files will be fetched
String filenames, //File names seperated by on Remote or FTP server to be fetched from the
String deletefile, //Delete file after file transfer from FTP Server to Database Server
String ErrorMessage[]
FullFtpClient FullFtpClient = new FullFtpClient();
int ErrorStatus = 0;
try
FullFtpClient = new FullFtpClient(host, port.intValue()); //Making FTP connection
FullFtpClient.login(username, password); //Logging on to FTP server
if (transtype == "ASCII")
FullFtpClient.ascii(); //Setting FTP transfer to ascii mode
if (transtype == "BINARY")
FullFtpClient.binary(); //Setting FTP transfer to binary mode
//ftpClient.cd(remotedir); //Set remote or FTP server directory
if (null != filenames)
int StartIndex = 0, PosIndex = 0;
String fname;
InputStream is;
int length;
byte[] buffer;
File file_out;
OutputStream os;
while (-1 != (PosIndex = filenames.indexOf("///",StartIndex)))
//For each filename the file will be fetched
fname = filenames.substring(StartIndex,PosIndex);
is = FullFtpClient.get(fname);
length = 1;
buffer = new byte[1024];
file_out = new File(localdir + "\\" + fname);
os = new FileOutputStream (file_out);
while((length = is.read(buffer)) != -1)
os.write(buffer, 0, length);
PosIndex += 3;
StartIndex = PosIndex;
if (deletefile != null)
FullFtpClient.delete (fname); // Remove file from FTP server
// Last, or only, filename;
if (StartIndex < filenames.length())
fname = filenames.substring(StartIndex);
is = FullFtpClient.get(fname);
length = 1;
buffer = new byte[1024];
file_out= new File(localdir + "\\" + fname);
os = new FileOutputStream (file_out);
while((length = is.read(buffer)) != -1)
os.write(buffer, 0, length);
if (deletefile != null)
FullFtpClient.delete (fname); // Remove file from FTP server
if (FullFtpClient != null)
// FullFtpClient.delete (filenames);
FullFtpClient.closeServer(); //Closing the FTP connection
catch (Exception e)
ErrorMessage[0] = e.toString();
ErrorStatus = 1;
return ErrorStatus;
Although I am catching the Exception, I get exceptions such as NullPointerException and Dele command could not delete file because access denied.
What I want is to transfer the file from ftp server and then delete it only after the transfer is complete. Secondly I want to handle any exception whatsoever arises during the execution of this code.
You help will be of gr8 help.
Thanx a lot
Alok

That is because I don't want to pile the files on the ftp server. Actually the file is transferred from ftp server on to the oracle server, then using javamail its sent to the user and after that there is no point keeping that file on the server. So I want to delete it from both the servers. I am able to delete the file from oracle server but I am unable to delete it from ftp server. Your help would be greatly appreciated.
Thanks & regards,
Alok

Similar Messages

  • Ftp error occurred in DW CS5. FTPClient also fails. Help Please!

    I'm about to pull my hair out. someone please help me.
    I have DW CS5 and my hosting company is brinkster. I have a domain name that was registered with enom and i changed the dns to direct to brinkster. this was a week ago. I tried to login to the ftp with dreamweaver and i get the ftp error message. I also cannot login using filezilla (ftp client). i have been in a chat with brinkster support for an hour and they can't figure out whats wrong. brinkster said they could connect fine. they tell me it is a local issue. what could be happening here? if anyone has a solution please help!
    i have other websites i have created using DW and brinkster hosting and do not have an issue signing into those accounts, it's only the new domain i cannot get access to. all of my settings are correct as i sent a screen shot to the brinkster tech and he said it was correct.
    i am using a wireless wpa2 connection. i have also tried it on a free network here at the apartment. no luck.
    any help would be great! thanks guys!

    well i just got off the online chat with brinkster. no fix.
    they tell me its a firewall or port problem but they cannot answer this question for me...
    i have 3 websites with brinkster. 2 of them are up and running perfectly and i can login anytime i want to (for example 5 minutes ago). the other one is the new site i am creating. i cannot sign into this with dreamweaver or ftpclient. i have tried it at a different location and i have a friend try it at a different location. i am using port 21 on all of my sites.
    so i ask them why can i log in to my other accounts and not this one? they have no answer. they tell me it is firewall or port 21 is blocked. wouldn't that be impossible if i can still login to my other accounts that use port 21 and from the same computer?
    this is VERY frustrating and i could lose a client over this.

  • Help Fetching files from an FTP server into a DBase or local folder

    Hello Gurus!
    I need help to automate or design/write an app capable of (replace a manual process) reading log files in an ftp server folder, this log files are called CDR (Call Detail Record) and named as follow cdr.txt.20020221010000 meaning that this log file was created on 2002/02/21 at 01:00:00.
    This CDR log files are generated every hour by a Lucent telephone switch using a software/program called EXS ExchangePlus in ASCII format (fixed length delaminated, Char data type). EXS ExchangePlus writes a record in this CDR/log files after the call is completed, i.e. Calling_Number, Called_Number, Date_connect (yyyymmdd), Time_connect (hhmmss), Charged_time (hhmmss, duration of the call), and so on.
    The manual process I am using now is:
    1. Log in the ftp server into the folder where the CDRs log files are, located the latest generated CDRs log files and downloaded them into a local folder/directory. Normally I download the CDR for full day or 24 CDRs log files.
    1a. Optionally sometimes I used a program called VEdit compiled/gather all 24 CDRs into a single file.
    2. Once I have downloaded the CDRs I want to process (normally I process a full day 24 CDRs) I imported then into a Data Base temp table, where then I do the conversion of data types (i.e. Dates and times fields from char type -> to ->Date type) and calculations for billing purposes.
    So if somebody can help with this, I would really appreciated ideas or any kind of information on how to automated this process.
    I�m familiar with Java2 platform (using JDeveloper ) so if somebody has done something like this before using java, this would very helpful. Or Maybe using Visual Basic 6.0 would help too.
    Thanks Gurus, and I look forward to hear from you soon!
    Alf Pathros!

    Thanks for the idea, even though an example would help me more.
    I already found the FTPClient class.
    I also would like to knwo if there is a away Ican append/merged various files CDRs into a single/one to then dump/import it into the database

  • Java.util.zip.ZipException: invalid entry size error --  help required

    Hi all
    I am sure this error would have been posted many number of times, but I would really appreciate if someone could help me with my problem. I am working on reading data from a .zip file, which in it has ~5GB data. All I am performing is a read operation through the piece of code specified below. This code worked well for .zip files handling till ~2.5GB
    FileInputStream fis = new FileInputStream(filename);
    BufferedInputStream bis = new BufferedInputStream(fis);
    ZipInputStream zis = new ZipInputStream(bis);
    StreamTokenizer tok = new StreamTokenizer( zis );
    ZipEntry entry;
    while((entry = zis.getNextEntry()) != null)
    \\read from the zip file through the streamTokenizer
    I just print what I read through the program, on the console.
    But the error I get is
    java.util.zip.ZipException: invalid entry size (expected 4294967295 but got 2117536490 bytes)
    at java.util.zip.ZipInputStream.readEnd(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.io.StreamTokenizer.read(Unknown Source)
    at java.io.StreamTokenizer.nextToken(Unknown Source)
    at ZipFileStreams.getMessages(ZipFileStreams.java:677)
    at ZipFileStreams.main(ZipFileStreams.java:814)
    Could anybody give me hints as to what am I missing and where am i going wrong. Any help would be appreciated.
    Thanks

    Hi,
    I get the same exception while reading a ZIP file. The size if the ZIP file is just 82KB but I am reading it over FTP not sure if it makes any difference. I am using JDK 1.4.2_05. Here is the code I am trying to execute.
    public class TestFTP {
    public static void main( String[] argv ) throws Exception {
    String inboundPath = "/transfer/inbound/";
    FTPClient ftp = new FTPClient();
    ftp.connect("123");
    ftp.login( "123", "123" );
    ftp.changeWorkingDirectory(inboundPath);
    FTPFile[] zipFiles = ftp.listFiles("*.zip");
    TelnetClient telnetClient;
    for(int i=0;i<zipFiles.length;i++){   
    System.out.println(zipFiles.getName());
    ZipInputStream zis = new ZipInputStream(ftp.retrieveFileStream(zipFiles[i].getName()));
    for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()){           
    System.out.println(entry.getName());
    The error message is
    java.util.zip.ZipException: invalid entry size (expected 10291 but got 10233 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
         at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
         at test.TestFTP.main(TestFTP.java:41)
    Exception in thread "main"
    Please let me know if you were able to fix the problem.
    Thanks

  • FTP download from AS400-Help me!

    Hi all,
    I'm very frustrated!!!!.
    I'm trying to download a file from AS400 via FTP using org.apache.commons.net.FTPClient class, but as i download it by
    ftpClient.retrieveFile(remotePath,anOutputStream)
    i get a no ASCII file (opening file in local machine with word pad i see very bizarre characters!).
    If i download the same file by using ftp client at command line:
    ftp>login
    etc..........
    adding ftp>bin command and ftp>get fileName i get the good result.
    How could I replace ftp "bin" command by using org.apache.commons.net.FTPClient class ?
    Thanks in advance!!!
    Fil

    EBCDICShouldn't it be the same problem then when using
    command line ftp and "bin" transfer mode like hedid
    (successfully)?Probably but I still think it worth trying EBCDIC
    mode. If it does not help then one thing has been
    eliminated.Hi,
    ftpClient.setFileType(FTP.EBCDIC_FILE_TYPE)
    does't work (I tried).
    I tested that ftp>bin command works fine.
    Mistery!!!!!
    Fil

  • Help! Downloading a file from remote Server

    I am currently doing a program for downloading a specified file from the remote server i.e from any website. If the downloading process stops in between due to some problem in the internet connection, then my program needs to start the downloading the file again to the local directory from where it was left.
    My idea is that, getting the size of the remote file initially when the downloading process starts and if the connection is interrupted, i will check the size of the downloaded file in the local directory with the remote file size. If the remote file size is greater than the localfile size, i need to start downloading the file where it was left i.e start downloading the next bit from the remote file.
    Is there any way to get the contents of the remote file from the specified point say 50th byte from a total file size of 100 kb using java?
    which concept to use FtpClient or sockets?
    iam a little bit confused!!!!
    Please help me.
    Thanks in advance.

    For HTTP you can use this function to open the stream with offset:
    InputStream openStream(URL url, long offset) {
        try {
            URLConnection uc = url.openConnection();
            uc.setRequestProperty("Authorization", "Basic " + (new BASE64Encoder()).encode("username:password".getBytes()));
            if (offset != 0 && url.openConnection().getHeaderField(0).toUpperCase().startsWith("HTTP/1.1"))
                uc.setRequestProperty("Range", "bytes=" + offset + "-");
            return new BufferedInputStream(uc.getInputStream());              
        } catch (MalformedURLException mfURLe) {
            System.err.println("Malformed URL in Client Updater. Unable to receive update list: " + mfURLe.getMessage());
        } catch (IOException ioe) {
            System.err.println("Unable to open input stream: " + ioe.getMessage());
        return null;
    }

  • How to load External Resources such as Jar's? Help in resolving ORA-29534

    Agenda: FTP files on Oracle 11g version 11.1.0.6.0 database server on Windows 2003 to another server. These files are generate using PL/SQL and Java Stored procedure
    Implementation Details: I wrote java stored procedure for FTPing files. Protocol is FTPS and I’m using Apache common’s library commons-net-ftp-2.0.jar.
    Now trying to load my project jar file using loadjava and it results into ORA-29534 error. I added location of commons-net-ftp-2.0.jar in the system class path and rebooted database server.
    Question:+ How do I tell oracle location of external_ JAR files? I also tried dropping external jar to jlib and jdk lib. No Luck!
    I will really appreciate your help…. Need to resolve it urgently for delivery
    See the details
    C:\TEMP>call loadjava -r -f -o -user <SCHEMA_NAME>/<PASSWORD>@ORCL projectFTPS.jar
    errors : class ftp/DibrsFTP
    ORA-29534: referenced object SFMIS5_2.ftp/DibrsFTPClient coul
    d not be resolved
    errors : class ftp/DibrsFTPClient
    ORA-29521: referenced name org/apache/commons/net/ftp/FTPSClient could not b
    e found
    ORA-29521: referenced name org/apache/commons/net/ftp/FTPClient could not be
    found
    The following operations failed
    class ftp/DibrsFTP: resolution
    class ftp/DibrsFTPClient: resolution
    exiting : Failures occurred during processing
    Thanks,
    Madan
    Edited by: MadanShah on Aug 8, 2009 8:00 AM

    using loadjava I can load commons-net-ftp-2.0.jar and my jar. When i execute pl/sql wrapper for defined java stored procedure it results into exception.
    retval=-29532;ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException
    Same code works as Java application. I also granted socket permissions
    DBMS_JAVA.GRANT_PERMISSION(
    'SCHEMANAME', 'java.net.SocketPermission', REPLACEWITHHOST||':'|| REPLACEWITHPORT, 'connect,resolve');
    This did not resolve the error. Since i do not have control external java library and it works as standalone application....
    do you know any workarounds? Any ideas on implementing FTP functionality in plsql on oracle 11g database?
    Thanks
    Madan
    Edited by: MadanShah on Aug 8, 2009 11:15 AM

  • 1.4 bug? or bad code?  please I need help

    FTPClient.getFile(inputStream out,String filename) works fine if inputStream is directed to an output file. I added a Thread to read inputStream using piped i/o and works fine but the thread never ends. Seems like readLine() does not return null. Please I need help.
    note: FTP package located finj.sourceforge.net
    import java.io.*;
    import org.finj.FTPClient;
    public class FTPSimpleDemo extends Object {
    public FTPSimpleDemo ( String server,
    String user,
    char[] password ) throws Exception {
    PipedOutputStream pipeOut = null;
    PipedInputStream pipeIn = null;
    Thread reader = null;
    FTPClient client =
    new FTPClient(server,user,password);
    //download file
    try {
    pipeOut = new PipedOutputStream();
    pipeIn = new PipedInputStream(pipeOut);
    reader = new PipeIn(pipeIn);
    reader.start();
    client.getFile(pipeOut, "J_Event.txt");
    while(reader.isAlive() ||
    !reader.isInterrupted));
    pipeOut.close();
    pipeIn.close();
    client.close();
    }catch(IOException e){e.getMessage();}
    finally {reader=null;}
    public static void main ( String[] args ) throws Exception {
    new FTPSimpleDemo(args[0], args[1],
    args[2].toCharArray());}
    class PipeIn extends Thread {
    private InputStream in;
    private String str;
    public PipeIn(InputStream in) {this.in = in;}
    public void run() {
    try {
    BufferedReader br = new BufferedReader(
    new InputStreamReader(in));
    while ((str=br.readLine()) != null)
    System.out.println(str);
    br.close();
    }catch (IOException e) {
    System.err.println(e.getMessage());}
    }

    Heres a tip: forget that open source library unless you need to customize it or something. Use the ftp library that comes wih the JDK. It is in an unsupported package (sun.net.ftp) check it out it couldn't be simpler:
    //you need this import statement
    import sun.net.ftp.*;
    //here is example code
    String server = "ftp.fileplanet.com";
    String user = "me";
    String passwd = "1234";
    FtpClient client = new FtpClient();
    client.openServer(server);
    client.login(user, passwd);
    client.binary();
    client.cd("games");
    //DO NOT CLOSE THIS INPUTSTREAM UNTIL YOU WANT TO CLOSE YOUR CONNECTION
    TelnetInputStream in = client.get("pacman.exe");
    //now do whatever u want with this inputstream
    byte[] bytes = new byte[4096];
    int x = 0;
    while((x = in.read(bytes)) != -1)
      out.write(bytes, 0, x);
      _totalBytes += x;
    out.flush();
    out.close();Also another tip for you to write code in the forum put your code between the [ code ] [ code ] tags

  • Can anyone help me in sending a file through FTP

    i have written a program to transfer files or directories in zipformat through FTP.i have also installed filezella server to check whether it is working or not.i have connected to filezella server but i am not able to send file.can any one send the code for sending the file.
    i have also tried the jakarta api sendfile ().but in that i don't what is mode means.
    for your reference i am sending the code as far developed.
    import java.io.*;
    import java.util.*;
    import java.util.zip.*;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    import org.apache.commons.net.ftp.*;
    import org.apache.commons.net.tftp.*;
    class FTPTransfer
    static public void main(String[]p)
    FTPTransfer ob = new FTPTransfer();
    // ob.Create_Zip_File(new File("outfile.zip"),new File[]{new File("c:\\trialtwo")}, false);
    ob.ftpConnect();
    // connecting to FTP server
    public void ftpConnect()
    boolean error = false;
    FTPClient ftp = null;
    try
    int reply;
    //ftp.connect("ftp.comcast.com");
    ftp = new FTPClient();
    ftp.connect( "localhost",21);
    // ftp.login( username, password );
    System.out.print("reply from FTP Server :"+ftp.getReplyString());
    // After connection attempt, you should check the reply code to verify
    // success.
    reply = ftp.getReplyCode();
    if(!FTPReply.isPositiveCompletion(reply)) {
    ftp.disconnect();
    System.err.println("FTP server refused connection.");
    System.exit(1);
    // ftp.sendFile();
    // transfer files
    // ftp.logout();
    TFTPClient tftp = new TFTPClient();
    System.out.print("before sending");
    tftp.sendFile("c:\\trialtwo\\a-1.txt",1,new FileInputStream("c:\\trialtwo\\a-1.txt"),"localhost",21);
    System.out.print("after sending");
    catch(IOException e)
    error = true;
    e.printStackTrace();
    finally
    if(ftp.isConnected())
    try
    ftp.disconnect();
    catch(IOException ioe)
    // do nothing
    System.exit(error ? 1 : 0);
    //send files
    // filename - The name the remote server should use when creating the file on its file system.
    // mode - The TFTP mode of the transfer (one of the MODE constants).
    // host - The remote host receiving the file.
    //port - The port number of the remote TFTP server.
    private void listContents( File Zip_File, File dir, ZipOutputStream out )
    throws Exception
    String[] files;
    files = dir.list();
    byte[] buf = new byte[1024];
    File[] file = dir.listFiles();
    for (int i = 0; i < file.length; i++) {
    System.out.println("*********** "+file);
    // File f = new File(dir,file[i]);
    try{
    FileInputStream in = new FileInputStream(file[i]);
    out.putNextEntry(new ZipEntry(file[i].getPath()));
    int len;
    while((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    in.close();
    catch(Exception e)
    zipEntry(Zip_File, file[i], out);
    } // end listContents()
    void Create_Zip_File(File Zip_File,File[] To_Be_Zipped_Files,boolean Skip_Dirs)
    try
    // Open archive file
    FileOutputStream stream=new FileOutputStream(Zip_File);
    ZipOutputStream out=new ZipOutputStream(stream);
    for (int i=0;i<To_Be_Zipped_Files.length;i++)
    //if (To_Be_Zipped_Files[i]==null
    // || !To_Be_Zipped_Files[i].exists()
    // || (Skip_Dirs ))
    // continue;
    System.out.println("Adding "+To_Be_Zipped_Files[i].getName());
    zipEntry(Zip_File, To_Be_Zipped_Files[i], out);
    out.close();
    stream.close();
    System.out.println("Finished zipping : "+ Zip_File.getAbsolutePath());
    catch (Exception e)
    e.printStackTrace();
    System.out.println("Error: " + e.getMessage());
    return;
    private void zipEntry(File Zip_File, File file, ZipOutputStream out) throws Exception
    if (file.isDirectory())
    listContents(Zip_File, file, out);
    return;

    You'll stand a better chance of getting help if you're more specific about what problems you're encountering. "Can't send file" doesn't say much.
    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

  • Please, please help find "orphaned" web pages

    I have spent the last 4 hours trying to delete "orphaned" web pages.  Several years ago I created some web pages using Front Page and then uploaded them to ftpmysite.verizon.net using an FTPClient.  Then I dumped Verizon's web suite altogether because it wasn't user friendly.  I've kept Verizon long term as my ISP only.
    Coming back full circle to Verizon because I need to use the 10 MB of space offered with my monthly DSL.  It is in use with the old pages.
    The pages DO NOT show up in site builder.
    SMARTFTP says user does not exist on the ftpmysite.verizon.net. login and the client times out
    SMARTFTP says user does not exist on the ftpmysite.ncnetwork.net login and the client times out
    SMARTFTP says user does not exist on the ftpmysite.verizon.net/resxxxxx login and the client times out
    SMARTFTP says user does not exist on the ftpmysite.ncnetwork.net resxxx login and the client times out
    The same for WinFTP.  Same for FTP via My Network places in Windows XP.
    MSIE returns Internet Explorer cannot display the webpage error with the above urls.
    The old site content shows up under the web page usage screen on the DSL Internet page, but it doesn't allow a page delete from that location.
    I'm fairly computer savy but I'm ready to rip Verizon a new one because this is insane!  Any advice on getting them off the remote server?
    Thanks in advance.

    I tested the DNS and reset the servers anew.  It didn't help.
    I then went to my neighbors and used his different ISP with dial-up.  Got a 550 Permissions Denied error.
    It has to be an issue on Verizon's end.
    They have escalated the problem.

  • Inserting the IP address into FTPclient.exe

    Hello All,
    I'm wondering if there is a way to insert the IP address into the FTPclient.exe and launch it?  I've seen this post and mpencke echos pretty much all of my concerns.
    - I don't want to reinvent the FTP utility.
    - I don't want to have to go through MAX
    - I don't want my users to have to download a separate piece of third party software and learn how to use it (if I can help it).
    All I need to do is display files and allow the user to browse through them, delete files, and on rare occasion, transfer one or two.  The FTPclient has everthing I need right there.  This will be a cleanup action, so even this will rarely be done.
    Back to mpencke's post, the way I read it nobody really answered his quetion, he simply assumed it is not possible outside of MAX based on the responses going elsewhere.  Is there a way to populate the IP address of the FTPclient?  If not, can somebody confirm that it is not possible and explain why?

    In order to use the windows ftp.exe via SysExec, you need to look at the ftp help on command line arguments.  In particular -s:filename, which allows the ftp client to run a scripted set of commands while inside of a session.  The idea being that you generate the file progrmatically, and then execute it via SysExec.
    FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuf
    fer] [-b:asyncbuffers] [-w:windowsize] [host]
    -v Suppresses display of remote server responses.
    -n Suppresses auto-login upon initial connection.
    -i Turns off interactive prompting during multiple file
    transfers.
    -d Enables debugging.
    -g Disables filename globbing (see GLOB command).
    -s:filename Specifies a text file containing FTP commands; the
    commands will automatically run after FTP starts.
    -a Use any local interface when binding data connection.
    -A login as anonymous.
    -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
    -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
    -b:async count Overrides the default async count of 3
    -w:windowsize Overrides the default transfer buffer size of 65535.
    host Specifies the host name or IP address of the remote
    host to connect to.
    Notes:
    - mget and mput commands take y/n/q for yes/no/quit.
    - Use Control-C to abort commands.
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • FtpClient client.delete("file") won't compile?

    Hello Fine People,
    I have this ftp program that is working, except for the delete command:
    import sun.net.ftp.*;
    import sun.net.*;
    String server = "192.168.0.0";
    String user = "me";
    String passwd = "mypassword";
    FtpClient client = new FtpClient();
    client.openServer(server);
    client.login(user, passwd);
    TelnetInputStream tis = null;
    client.binary();
    client.cd("Composites");
    tis = client.list();
    client.get("filename");
    client.delete("filename");
    This is roughly how it is. Without the last line, it compiles and runs fine. But when I add the client.delete line, it won't compile and gives this error:
    ImageTransfer.java:229: cannot resolve symbol
    symbol : method delete (java.lang.String)
    location: class sun.net.ftp.FtpClient
    client.delete("filename");
    Please help!
    - Logan

    Yes. The class you should be importing is, obviously, FTPClient. But don't waste your time trying to compile what is clearly just a code fragment example. The article lists several sources of FTP client software. Once you have chosen one package to evaluate, write your test program using the actual classes from that package, using its API documentation for guidance.

  • Help - Forte Can't Find the Browser

    Help! I've installed Forte on Windows NT 4.0, it will compile and build successfully, but when I try to execute,I get the message
    "Could not access the URL through the external browser". It also says that when I hit the "Web Browser" option in the Menu bar.
    The log file follows, so you can see all my settings and stuff. Internet Explorer is my default browser.
    Thanks! I'm stuck!
    +++++++++
    Log Session: Saturday, August 2, 2003 11:59:10 AM BST
    System Info: Product Version = Forte for Java, CE v. 3.0 (Build 010925)
    IDE Versioning = IDE/1 spec=1.2.2 impl=010925
    Operating System = Windows NT version 4.0 running on x86
    Java; VM; Vendor = 1.3.1_01; Java HotSpot(TM) Client VM 1.3.1_01; Sun Microsystems Inc.
    Java Home = D:\JDK13~1.1_0\jre
    System Locale = en_US (f4j_ce)
    Home Dir; Current Dir = C:\WINNT\Profiles\Administrator; d:\forte4j\bin
    IDE Install; User Dir = D:\forte4j; D:\WorkForte
    CLASSPATH = D:\forte4j\lib\patches\openide-compat.jar;D:\forte4j\lib\locale\core_f4j.jar;D:\forte4j\lib\locale\core_f4j_ce.jar;D:\forte4j\lib\locale\core_f4j_ce_ja.jar;D:\forte4j\lib\locale\core_f4j_ja.jar;D:\forte4j\lib\locale\core_ja.jar;D:\forte4j\lib\locale\openide_f4j.jar;D:\forte4j\lib\locale\openide_ja.jar;D:\forte4j\lib\locale\updater_ja.jar;D:\forte4j\lib\core.jar;D:\forte4j\lib\openide-fs.jar;D:\forte4j\lib\openide-nodes.jar;D:\forte4j\lib\openide-util.jar;D:\forte4j\lib\openide.jar;D:\forte4j\lib\ext\locale\ddl_ja.jar;D:\forte4j\lib\ext\locale\logger_ja.jar;D:\forte4j\lib\ext\locale\rmi-ext_ja.jar;D:\forte4j\lib\ext\bsh-1_0-fj.jar;D:\forte4j\lib\ext\cmd.jar;D:\forte4j\lib\ext\cosnaming.jar;D:\forte4j\lib\ext\ddl.jar;D:\forte4j\lib\ext\fjscript.jar;D:\forte4j\lib\ext\flute.jar;D:\forte4j\lib\ext\fscontext.jar;D:\forte4j\lib\ext\idlcompilers.jar;D:\forte4j\lib\ext\jaas.jar;D:\forte4j\lib\ext\jaxp.jar;D:\forte4j\lib\ext\jh.jar;D:\forte4j\lib\ext\jndi.jar;D:\forte4j\lib\ext\ldap.jar;D:\forte4j\lib\ext\ldapbp.jar;D:\forte4j\lib\ext\logger.jar;D:\forte4j\lib\ext\nis.jar;D:\forte4j\lib\ext\openorb-1.0.2.jar;D:\forte4j\lib\ext\parser.jar;D:\forte4j\lib\ext\pbclient.jar;D:\forte4j\lib\ext\providerutil.jar;D:\forte4j\lib\ext\regexp.jar;D:\forte4j\lib\ext\rmi-ext.jar;D:\forte4j\lib\ext\rmiregistry.jar;D:\forte4j\lib\ext\sac.jar;D:\forte4j\lib\ext\sax2.jar;D:\forte4j\lib\ext\servlet.jar;D:\forte4j\lib\ext\xerces.jar;D:\forte4j\lib\ext\jdbc20x.zip;D:\JDK13~1.1_0\lib\dt.jar;D:\JDK13~1.1_0\lib\tools.jar
    [INFO] Loaded modules: org.netbeans.core/1 (1.0.1/unspec); com.sun.ffj.modules.registration (1.0/010925); com.sun.forte4j.modules.dd/1 (1.0/010925); com.sun.forte4j.modules.pointbase/1 (1.2/010925); org.apache.tools.ant.module/2 (2.2.2/010925); org.netbeans.modules.autoupdate/1 (2.0.1/010925); org.netbeans.modules.clazz/1 (1.6.2/010925); org.netbeans.modules.db/1 (1.4/010925); com.sun.forte4j.modules.dbmodel.jdbcimpl/1 (1.2/010925); org.netbeans.modules.debugger.core/2 (2.0.2/010925); org.netbeans.modules.applet/1 (1.6.2/010925); org.netbeans.modules.debugger.debug/1 (1.8.2/010925); org.netbeans.modules.debugger.jpda/1 (1.8.2/010925); org.netbeans.modules.editor/1 (1.7.2/010925); org.netbeans.modules.corba.idl.editor/1 (1.2/010925); org.netbeans.modules.filecopy/1 (1.4/010925); org.netbeans.modules.html/1 (1.7.2/010925); org.netbeans.modules.httpserver/1 (1.6.2/010925); org.netbeans.modules.extbrowser/1 (0.2.2/010925); org.netbeans.modules.image/1 (1.6.2/010925); org.netbeans.modules.jarpackager/2 (1.6.2/010925); org.netbeans.modules.java/1 (1.6.2/010925); com.sun.forte4j.persistence.internal.ui/1 (1.2/010925); org.netbeans.modules.beans/1 (1.6.2/010925); org.netbeans.modules.corba/1 (1.4/010925); org.netbeans.modules.form/2 (1.6.2/010925); org.netbeans.modules.javadoc/1 (1.6.2/010925); org.netbeans.modules.jndi/1 (1.4.1/010925); org.netbeans.modules.logger/1 (1.2.1/010925); com.sun.forte4j.modules.depclass/1 (1.1/010925); org.netbeans.modules.objectbrowser/1 (1.6.2/010925); org.netbeans.modules.projects/1 (1.6.2/010925); org.netbeans.modules.properties/1 (1.6.2/010925); org.netbeans.modules.i18n/1 (1.7.1/010925); org.netbeans.modules.i18n.form/2 (1.7.1/010925); org.netbeans.modules.jdbc/1 (1.2/010925); org.netbeans.modules.properties.syntax/1 (1.6.2/010925); org.netbeans.modules.text/1 (1.6.2/010925); org.netbeans.modules.usersguide/1 (1.7.3/010925); org.netbeans.modules.xml/1 (1.5/010925); org.netbeans.modules.xml.editor.coloring/1 (1.2/010925); org.openidex.util/1 (1.7.1/010925); org.netbeans.modules.j2eeserver/1 (1.1.3/010925); org.netbeans.modules.utilities/1 (1.6.2/010925); com.sun.forte4j.j2ee.lib/1 (1.0/010925); org.netbeans.modules.apisupport.lite/1 (0.1.2/010925); org.netbeans.modules.rmi/1 (1.3.2/010925); org.netbeans.modules.vcscore/1 (1.4.1.1/010925); org.netbeans.modules.cvsclient/1 (1.3.2/010925); org.netbeans.modules.vcs.advanced/1 (1.4.1.1/010925); org.netbeans.modules.vcs.cmdline/1 (1.7.1.1/010925); org.netbeans.modules.web.core/1 (1.2.2/010925); org.netbeans.modules.web.core.syntax/1 (1.2.2/010925); org.netbeans.modules.web.ie/1 (1.4/010925); org.netbeans.modules.web.tomcat/1 (1.2.2/010925); com.iplanet.iws.integ.forte/1 (1.1/200108081113)
    path="" :jsp: init
    [IDE-Exec] Executing:
    0 .= D:\JDK13~1.1_0\jre\..\bin\javac
    1 .= -g
    2 .= -encoding
    3 .= UTF8
    4 .= -classpath
    5 .= D:\WorkForte\system;D:\forte4j\system;D:\forte4j\beans\TimerBean.jar;D:\WorkForte\jspwork\Tomcat+3.2\50439630;D:\WorkForte\CDShopcart;D:\WorkForte\CDShopcart\WEB-INF\lib\dbtags.jar;D:\WorkForte\CDShopcart\WEB-INF\lib\ietags.jar;D:\WorkForte\jspwork\Tomcat+3.2\6fad47ea;D:\WorkForte\CDShopcart\WEB-INF\classes;D:\forte4j\modules\ext\persistence-rt.jar;D:\forte4j\modules\ext\AbsoluteLayout.jar;D:\forte4j\modules\ext\sql.jar;D:\forte4j\modules\ext\rowset.jar;D:\forte4j\lib\ext\jdbc20x.zip;D:\forte4j\lib\ext\servlet.jar;D:\forte4j\lib\ext\xerces.jar;D:\forte4j\modules\ext\webserver.jar;D:\forte4j\modules\ext\jasper.jar;
    6 .= D:\WorkForte\jspwork\Tomcat+3.2\6fad47ea\_0002fProductList_0002ejspProductList_jsp_1.java
    [IDE-Exec] Executing:
    0 .= D:\JDK13~1.1_0\jre\bin\java
    1 .= -cp
    2 .= D:\WorkForte\CDShopcart\WEB-INF\classes;D:\WorkForte\CDShopcart\WEB-INF\lib\dbtags.jar;D:\WorkForte\CDShopcart\WEB-INF\lib\ietags.jar;D:\WorkForte\CDShopcart;D:\WorkForte\CDShopcart\WEB-INF\classes;D:\WorkForte\CDShopcart\WEB-INF\lib\dbtags.jar;D:\WorkForte\CDShopcart\WEB-INF\lib\ietags.jar;D:\WorkForte\jspwork\Tomcat+3.2\50439630;D:\WorkForte\jspwork\Tomcat+3.2\6fad47ea;D:\WorkForte\system;D:\forte4j\beans\TimerBean.jar;D:\forte4j\lib\ext\jdbc20x.zip;D:\forte4j\lib\ext\servlet.jar;D:\forte4j\modules\ext\AbsoluteLayout.jar;D:\forte4j\modules\ext\persistence-rt.jar;D:\forte4j\modules\ext\rowset.jar;D:\forte4j\modules\ext\sql.jar;D:\forte4j\system;D:\forte4j\lib\locale\core_f4j.jar;D:\forte4j\lib\locale\core_f4j_ce.jar;D:\forte4j\lib\locale\core_f4j_ce_ja.jar;D:\forte4j\lib\locale\core_f4j_ja.jar;D:\forte4j\lib\locale\core_ja.jar;D:\forte4j\lib\locale\openide_f4j.jar;D:\forte4j\lib\locale\openide_ja.jar;D:\forte4j\lib\locale\updater_ja.jar;D:\forte4j\lib\core.jar;D:\forte4j\lib\openide-fs.jar;D:\forte4j\lib\openide-nodes.jar;D:\forte4j\lib\openide-util.jar;D:\forte4j\lib\openide.jar;D:\forte4j\lib\ext\locale\ddl_ja.jar;D:\forte4j\lib\ext\locale\logger_ja.jar;D:\forte4j\lib\ext\locale\rmi-ext_ja.jar;D:\forte4j\lib\ext\bsh-1_0-fj.jar;D:\forte4j\lib\ext\cmd.jar;D:\forte4j\lib\ext\cosnaming.jar;D:\forte4j\lib\ext\ddl.jar;D:\forte4j\lib\ext\fjscript.jar;D:\forte4j\lib\ext\flute.jar;D:\forte4j\lib\ext\fscontext.jar;D:\forte4j\lib\ext\idlcompilers.jar;D:\forte4j\lib\ext\jaas.jar;D:\forte4j\lib\ext\jaxp.jar;D:\forte4j\lib\ext\jh.jar;D:\forte4j\lib\ext\jndi.jar;D:\forte4j\lib\ext\ldap.jar;D:\forte4j\lib\ext\ldapbp.jar;D:\forte4j\lib\ext\logger.jar;D:\forte4j\lib\ext\nis.jar;D:\forte4j\lib\ext\openorb-1.0.2.jar;D:\forte4j\lib\ext\parser.jar;D:\forte4j\lib\ext\pbclient.jar;D:\forte4j\lib\ext\providerutil.jar;D:\forte4j\lib\ext\regexp.jar;D:\forte4j\lib\ext\rmi-ext.jar;D:\forte4j\lib\ext\rmiregistry.jar;D:\forte4j\lib\ext\sac.jar;D:\forte4j\lib\ext\sax2.jar;D:\forte4j\lib\ext\servlet.jar;D:\forte4j\lib\ext\xerces.jar;D:\forte4j\lib\ext\jdbc20x.zip;D:\JDK13~1.1_0\lib\dt.jar;D:\JDK13~1.1_0\lib\tools.jar;D:\forte4j\modules\registration.jar;D:\forte4j\modules\dd2beans.jar;D:\forte4j\modules\pointbase.jar;D:\forte4j\modules\ant.jar;D:\forte4j\modules\ext\ant-optional.jar;D:\forte4j\modules\docs\ant-manual.zip;D:\forte4j\modules\ext\ant.jar;D:\forte4j\modules\autoupdate.jar;D:\forte4j\modules\clazz.jar;D:\forte4j\modules\db.jar;D:\forte4j\modules\dbschema.jar;D:\forte4j\modules\debuggerCore.jar;D:\forte4j\modules\applet.jar;D:\forte4j\modules\toolsDebugger.jar;D:\forte4j\modules\jpdaDebugger.jar;D:\forte4j\modules\editor.jar;D:\forte4j\modules\ext\nb-editor.jar;D:\forte4j\modules\idl-syntax.jar;D:\forte4j\modules\filecopy.jar;D:\forte4j\modules\ext\ftpclient.jar;D:\forte4j\modules\html.jar;D:\forte4j\modules\httpserver.jar;D:\forte4j\modules\ext\webserver.jar;D:\forte4j\modules\extbrowser.jar;D:\forte4j\modules\image.jar;D:\forte4j\modules\jarpackager.jar;D:\forte4j\modules\java.jar;D:\forte4j\modules\ext\javac.jar;D:\forte4j\modules\ext\java-gj.jar;D:\forte4j\modules\persistence-ui.jar;D:\forte4j\modules\ext\persistence-rt.jar;D:\forte4j\modules\beans.jar;D:\forte4j\modules\corba.jar;D:\forte4j\modules\form.jar;D:\forte4j\modules\ext\AbsoluteLayout.jar;D:\forte4j\modules\javadoc.jar;D:\forte4j\modules\jndi.jar;D:\forte4j\modules\loggerModule.jar;D:\forte4j\modules\classfile.jar;D:\forte4j\modules\browser.jar;D:\forte4j\modules\ext\infobus.jar;D:\forte4j\modules\projects.jar;D:\forte4j\modules\properties.jar;D:\forte4j\modules\i18n.jar;D:\forte4j\modules\i18n-form.jar;D:\forte4j\modules\jdbc.jar;D:\forte4j\modules\ext\rowset.jar;D:\forte4j\modules\ext\sql.jar;D:\forte4j\modules\properties-syntax.jar;D:\forte4j\modules\text.jar;D:\forte4j\modules\usersguide.jar;D:\forte4j\modules\xml.jar;D:\forte4j\modules\xml-syntax.jar;D:\forte4j\modules\openidex.jar;D:\forte4j\modules\j2eeserver.jar;D:\forte4j\modules\utilities.jar;D:\forte4j\modules\locale\utilities_f4j.jar;D:\forte4j\modules\j2eelib.jar;D:\forte4j\modules\apisupport-lite.jar;D:\forte4j\modules\rmi.jar;D:\forte4j\modules\vcscore.jar;D:\forte4j\modules\javacvs.jar;D:\forte4j\modules\ext\cvslib.jar;D:\forte4j\modules\vcsgen.jar;D:\forte4j\modules\cvs.jar;D:\forte4j\modules\jsp.jar;D:\forte4j\modules\ext\jasper.jar;D:\forte4j\modules\jsp-syntax.jar;D:\forte4j\modules\jspie.jar;D:\forte4j\modules\jsp-tomcat.jar;D:\forte4j\modules\ext\tomcat-monitor.jar;D:\forte4j\modules\iplanet_wsae.jar
    3 .= org.netbeans.modules.web.tomcat.WebAppMain
    4 .= D:\WorkForte\system\tomcat\server.xml
    5 .= D:\WorkForte\system\tomcat
    *********** Exception occurred ************
    Sat Aug 02 12:08:13 BST 2003: org.netbeans.modules.extbrowser.NbBrowserException: RegOpenKeyEx() failed.
    Annotation: Could not access the URL through the external browser. Check the configuration in Tools | Options | Web Browsers.
    org.netbeans.modules.extbrowser.NbBrowserException: RegOpenKeyEx() failed.
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl.getBrowserPath(Native Method)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl.access$600(NbDdeBrowserImpl.java:39)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer.startBrowser(NbDdeBrowserImpl.java:364)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer.run(NbDdeBrowserImpl.java:275)
         at java.lang.Thread.run(Thread.java:484)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl.setURL(NbDdeBrowserImpl.java:181)
    [catch] at org.openide.awt.HtmlBrowser$1.run(HtmlBrowser.java:401)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    *********** Exception occurred ************
    Sat Aug 02 12:08:49 BST 2003: java.lang.IllegalMonitorStateException: null
    java.lang.IllegalMonitorStateException
         at org.netbeans.core.execution.TaskThreadGroup.isProcessDead(TaskThreadGroup.java:111)
         at org.netbeans.core.execution.TaskThreadGroup.waitFor(TaskThreadGroup.java:119)
         at org.netbeans.core.execution.DefaultSysProcess.result(DefaultSysProcess.java:71)
    [catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:124)

    This happened to me also (I'm using Windows XP though). It's because Forte doesn't know how to communicate with Explorer through DDE (at least on some peoples' systems). You can tell Forte to launch the browser through the command line, and that should work. To do this, go to Tools, Options, IDE Configuration, System, System Settings and choose External Browser (Command Line) from the dropdown. Then go to IDE Configuration, Server and External Tools, Web Browsers, External Browser (Command Line) and under Browser Executable write C:\Program Files\Internet Explorer\iexplore.exe URL (of course, use the appropriate path to iexplore.exe if it's not the one above). Or, you could just select Forte's internal Swing-based browser under System Settings, but it doesn't have as many features as Internet Explorer.

  • I really need a good help - Applets

    Well, i4m posting again, because i4ve got no answers, and i really need to run an applet.
    My environment is an NT Server with the database (8.0.5.1) and OAS (4.0.8) and i4m trying to run an applet in another NT machine (the same where i have JDev 3.0 installed).
    I don4t know if i4ve set all the needed to run an simple applet with database access, so i really need to know, step-by-step, what4s to do.
    My applet don4t run and in the java console i4ve read some errors, posted below :
    in IE 5.0 ->
    java.lang.NoClassDefFoundError: oracle/dacf/dataset/AppModuleInfo
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:241)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:508)
    at sun.plugin.AppletViewer.createApplet(AppletViewer.java:814)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:444)
    at sun.applet.AppletPanel.run(AppletPanel.java:282)
    at java.lang.Thread.run(Thread.java:479)
    in Netscape 4.7 ->
    load: class package10.Applet1.class not found.
    java.lang.ClassNotFoundException: java.io.FileNotFoundException: \Brasil\C\Web\Alessandro\package10\Applet1\class.class (The system cannot find the path specified)
    I4m trying real hard to run an applet and i4m becoming desperated !!! I know and hope that4s only something real easy was forgotten.
    Can u help me ? Thanks !
    null

    Ok, i4ve put my bussines.jar (the file where my Bussiness Components are) in the java_ARCHIVE tag and now the error changed :
    load: class package10.Applet1.class not found.
    java.lang.ClassNotFoundException: java.net.ConnectException: Connection refused: no further information
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
    at java.net.Socket.<init>(Socket.java:269)
    at java.net.Socket.<init>(Socket.java:98)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
    at sun.net.NetworkClient.openServer(NetworkClient.java:42)
    at sun.net.ftp.FtpClient.openServer(FtpClient.java:271)
    at sun.net.ftp.FtpClient.<init>(FtpClient.java:385)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:82)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:101)
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:228)
    at sun.applet.AppletClassLoader.access$1(AppletClassLoader.java:218)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:141)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:138)
    at sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java:198)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:112)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:377)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:508)
    at sun.plugin.AppletViewer.createApplet(AppletViewer.java:814)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:444)
    at sun.applet.AppletPanel.run(AppletPanel.java:282)
    at java.lang.Thread.run(Thread.java:479)
    What4s wrong now ? My html and jar files are all in the same directory on the Web Server.
    Can u help ?
    Thanks !

  • FtpClient.class Source Code

    I encountered a BUG while developing a program that uses FTP. I would need to change a few lines of code on the FtpClient.java source. I dont know where to get the source code for the class. I tried using JAD to decompile, but recompiling produces syntax errors. The bug involves having 2 NICS on the machine. Can anyone help me on this?

    Unfortunately, it's the FTPClient.class from sun. The
    bug ID is 4107059. I tried JAD and decaf but i cant
    recompile it back. =(You can't get the source for it, it is in the Sun package. They are classes you shouldn't use.

Maybe you are looking for