KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > coldcore > coloradoftp > filter > DataFilter


1 package com.coldcore.coloradoftp.filter;
2
3 import java.nio.channels.ByteChannel JavaDoc;
4 import java.nio.channels.ReadableByteChannel JavaDoc;
5 import java.nio.channels.WritableByteChannel JavaDoc;
6
7 /**
8  * Filter for data upload/download.
9  *
10  * This data filter sits in the channel (e.g. mounted to file) and parses channels's data on the fly.
11  * Filter must be able to do parsing both ways: from server to user and vice versa.
12  *
13  * Data filters are applied to server's data channels by a data filter applicator based on
14  * the previous user commands (e.g. MODE, TYPE and STRU).
15  *
16  *
17  * ColoradoFTP - The Open Source FTP Server (http://cftp.coldcore.com)
18  */

19 public interface DataFilter extends ByteChannel JavaDoc {
20
21   /** Set filter name
22    * @param name Filter name
23    */

24   public void setName(String JavaDoc name);
25
26
27   /** Get filter name
28    * @return Filter name
29    */

30   public String JavaDoc getName();
31
32
33   /** Set the original channel to filter
34    * @param wbc Data channel
35    */

36   public void setChannel(WritableByteChannel JavaDoc wbc);
37
38
39   /** Set the original channel to filter.
40    * @param rbc Data channel
41    */

42   public void setChannel(ReadableByteChannel JavaDoc rbc);
43
44
45   /** Test if this data filter may change the length of data in a stream.
46    * Some data filters may modify content and size of the file being transferred
47    * on the fly but with the REST command in place the output file may be currupted.
48    * This method prevents commands which operate on file size from executing.
49    * @return TRUE if data length in a stream may change, FALSE if data length will never change
50    */

51   public boolean mayModifyDataLength();
52 }
53
Popular Tags