Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: How to delete an FTP file?

Reply
Thread Tools

Re: How to delete an FTP file?

 
 
Scott Yanoff
Guest
Posts: n/a
 
      07-22-2003
Biuri wrote:
> I simply need the code to DELETE a file from an ftp connection (I'm
> able to estabilish the connection, to read a file and to write a
> file...but not to delete!!... )


What FTP package are you using?
I know that with com.enterprisedt.net.ftp you can do:
FTPClient.delete(String filename);

Good luck,

--
-Scott
| http://www.yanoff.org | AOL IM: SAY KJY

 
Reply With Quote
 
 
 
 
Biuri
Guest
Posts: n/a
 
      07-23-2003
> What FTP package are you using?
> I know that with com.enterprisedt.net.ftp you can do:
> FTPClient.delete(String filename);
>
> Good luck,


I'm tring to implement something very simple for a project with my
friends.I want to use only Java package, without other libraries...In
Java this is a swear,but until now I got it...
This is part of the code to make you understand how I'm proceeding:

/* Creates a file in the path specified, in which
* ther's written the String what. */
public void writeFile(String username, String password,
String filePath, String what) {
try {
URL url = new
URL("ftp://"+username+":"+password+"@"+filePath);
URLConnection urlc = url.openConnection();
OutputStream os = urlc.getOutputStream();
PrintWriter out = new PrintWriter(os);
out.println(what);
out.close();
}
catch (MalformedURLException e) { System.out.println("Not
valid URL"); }
catch (IOException e) { System.out.println("Errore di I/O"); }

}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sun.net.ftp.FtpProtocolException: Error reading FTP pending reply long990802@gmail.com Java 3 12-11-2005 02:46 AM
Re: ftplib question - ftp.dir() returns something and ftp.nlst()does not Nico Grubert Python 0 11-25-2005 10:09 AM
ftplib question - ftp.dir() returns something and ftp.nlst() does not Nico Grubert Python 0 11-24-2005 02:00 PM
Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server. D. Buck Perl Misc 2 06-29-2004 02:05 PM
FTP over SSL vs FTP over SSH someone Java 1 04-25-2004 03:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57