View Javadoc

1   package org.opensync.engine.server;
2   
3   import java.io.*;
4   
5   /***
6    * The protocol interface represents the protocol used to get information from
7    * the source like the tcp,ftp,http,... protocols
8    */
9   
10  public interface Protocol {
11    /***
12     * The protocol use to get and put file on a Windows network
13     *
14     *
15     */
16    public final static String WIN_FILE = "win_file";
17    /***
18     * The protocol use to get and put file by FTP
19     *
20     */
21    public final static String FTP = "ftp";
22  
23    /***
24     * Get the name of the protocol
25     *
26     */
27    public String getName();
28    /***
29     * Get the folder use by the protocol to get and put files
30     *
31     */
32    public String getFolder();
33    /***
34     * Put the <code>fileContent</code> in the file <code>fileName</code> int
35     * the <code>folder</code> directory
36     *
37     * @param	fileContent the file content
38     * @param	fileName the file name
39     * @exception	OpenSyncException
40     * @exception	IOException
41     */
42    public void putView(String fileContent,String fileName)throws OpenSyncException,IOException;
43    /***
44     * Get the content of files <code>fileName</code>
45     *
46     * @param	fileName the file name (may use *)
47     * @exception	OpenSyncException
48     * @exception	IOException
49     */
50    public String[] getViews(String fileName)throws OpenSyncException,IOException;
51  
52    /***
53     *
54     * @param fileName
55     * @throws OpenSyncException
56     * @throws IOException
57     */
58    public void init();
59    /***
60     * Clean files (rename or remove) if necessary after the synchronisation done.
61     *
62     * @param	fileName the file name to clean
63     * @exception	OpenSyncException
64     * @exception	IOException
65     */
66    public void clean(String fileName)throws OpenSyncException,IOException;
67  
68  
69  }