1 |
/* |
/* |
2 |
* $Id$ |
* DTPOutputStream.java |
3 |
* Copyright (C) 2003 The Free Software Foundation |
* Copyright (C) 2003 The Free Software Foundation |
4 |
* |
* |
5 |
* This file is part of GNU inetlib, a library. |
* This file is part of GNU inetlib, a library. |
46 |
* An output stream that notifies a DTP on end of stream. |
* An output stream that notifies a DTP on end of stream. |
47 |
* |
* |
48 |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
|
* @version $Revision$ $Date$ |
|
49 |
*/ |
*/ |
50 |
abstract class DTPOutputStream extends FilterOutputStream |
abstract class DTPOutputStream |
51 |
|
extends FilterOutputStream |
52 |
{ |
{ |
53 |
|
|
54 |
DTP dtp; |
DTP dtp; |
59 |
* @param dtp the controlling data transfer process |
* @param dtp the controlling data transfer process |
60 |
* @param out the socket output stream |
* @param out the socket output stream |
61 |
*/ |
*/ |
62 |
DTPOutputStream (DTP dtp, OutputStream out) |
DTPOutputStream(DTP dtp, OutputStream out) |
63 |
{ |
{ |
64 |
super (out); |
super(out); |
65 |
this.dtp = dtp; |
this.dtp = dtp; |
66 |
transferComplete = false; |
transferComplete = false; |
67 |
} |
} |
68 |
|
|
69 |
/** |
/** |
70 |
* Tells this stream whether transfer has completed or not. |
* Tells this stream whether transfer has completed or not. |
71 |
* @param flag true if the process has completed, false otherwise |
* @param flag true if the process has completed, false otherwise |
72 |
*/ |
*/ |
73 |
void setTransferComplete (boolean flag) |
void setTransferComplete(boolean flag) |
74 |
{ |
{ |
75 |
transferComplete = flag; |
transferComplete = flag; |
76 |
} |
} |
77 |
|
|
78 |
/** |
/** |
79 |
* Notifies the controlling DTP that this stream has been terminated. |
* Notifies the controlling DTP that this stream has been terminated. |
80 |
*/ |
*/ |
81 |
public void close () throws IOException |
public void close() |
82 |
{ |
throws IOException |
83 |
dtp.transferComplete (); |
{ |
84 |
} |
dtp.transferComplete(); |
85 |
|
} |
86 |
|
|
87 |
} |
} |
88 |
|
|