You are on page 1of 2

30-01-2011 Koders Code Search: FtpWriter.

java - Ja…

java

All Languages All Licenses

FtpWriter.java Project Info


Language: Java jEdit
License: GPL Server: SourceForge
download Type: cvs
C opyright: (C ) 1998, C hris C heetham, fooware *
LOC : 15

1 /*************************************************************************
...lugins\FTP\com\fooware\net\ 2 * Copyright (C) 1998, Chris Cheetham, fooware *
3 * Distributed under the GNU General Public License *
FtpC lient.java 4 * http://www.fsf.org/copyleft/gpl.html *
FtpInputStream.java
5 *************************************************************************/
FtpOutputStream.java
FtpReader.java 6
FtpResponse.java 7 package com.fooware.net;
FtpWriter.java 8
9 import java.io.FilterWriter;
10 import java.io.Writer;
11
12 import java.io.IOException;
13
14 /**
15 * This is an object that can be used as a java.io.Writer for the
16 * writing of data to an FTP server. You do not construct one
17 * explicitly, but via an FtpClient:<BR>
18 * <CODE><PRE>
19 * FtpClient ftp = new FtpClient();
20 * ftp.connect(someServer);
21 * ftp.userName(myName);
22 * ftp.password(myPassword);
23 * ftp.dataPort();
24 * <B>FtpWriter out = ftp.store(targetFile);
25 * while (someReader.ready())
26 * out.write(someReader.read());
27 * in.close();</B>
28 * </PRE></CODE>
29 * Note: unlike other Writers, it is important to explicitly close this
30 * Writer when through. This signals the FtpClient to get a response
31 * from the FTP server.
32 * @author <A HREF="mailto:cheetham@fooware.com">Chris Cheetham</A>
33 * @version $Revision: 1.1 $
34 **/
35 public class FtpWriter extends FilterWriter {
36
37 //
38 // constructors
39 //
40
41 /**
42 * Contruct an FtpWriter for the specified FtpClient.
43 **/
44 FtpWriter(Writer out, FtpClient client) throws IOException {
45 super(out);
46 this.client = client;
47 }
48
49 /**
50 * Close the underlying Writer and signal the FtpClient that
51 * Writer processing has completed.
52 **/
53 public void close() throws IOException {
54 super.close();
55 client.closeTransferSocket();
56 }
57
58 //
59 // member variables

koders.com/…/fidD013580CDCC112288… 1/2
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
30-01-2011 Koders Code Search: FtpWriter.java - Ja…
60 //
61
62 private FtpClient client;
63
64 }

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy
Policy | Site Map| Contact Us

©2010 Koders is a trademark of Black Duck Software, Inc. Black Duck, Know Your C ode and the Black Duck logo are
registered trademarks of Black Duck Software, Inc. in the United States and other jurisdictions. All other trademarks are the
property of their respective holders.

koders.com/…/fidD013580CDCC112288… 2/2
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

You might also like