KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > module > builders > vwms > aFile2Copy


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.module.builders.vwms;
11
12 import java.lang.String JavaDoc;
13
14 /**
15  * An object that holds information needed for the transfer of a file.
16  * This is used with the CAHE PAGE mechanism, which copies calculated pages to a mirror server.
17  * File2Copy objects are handled by the {@link FileCopier} class.
18  *
19  * @rename AFile2Copy
20   * @author Daniel Ockeloen
21  * @author Pierre van Rooden (javadocs)
22  * @version $Id: aFile2Copy.java,v 1.8 2003/03/10 11:50:27 pierre Exp $
23  */

24
25 public class aFile2Copy {
26
27     /**
28      * Name of the destination user.
29      * Needed to log in to the host (using ssh).
30      */

31     public String JavaDoc dstuser;
32     /**
33      * Name of the destination host
34      */

35     public String JavaDoc dsthost;
36     /**
37      * Requested path of the file at the destination host
38      */

39     public String JavaDoc dstpath;
40     /**
41      * Path of the file at this server
42      */

43     public String JavaDoc srcpath;
44     /**
45      * File name
46      */

47     public String JavaDoc filename;
48     /**
49      * Path to ssh command
50      */

51     public String JavaDoc sshpath;
52
53     /**
54      * Constructor for the File2Copy object
55      * @param dstuser User name needed to log on at the destination host
56      * @param dsthost Name of the destination host
57      * @param dstpath Requested path of the file at the destination host
58      * @param srcpath Path of the file at this server
59      * @param filename File name
60      * @param sshpath Path to ssh command
61      */

62     public aFile2Copy(String JavaDoc dstuser,String JavaDoc dsthost,String JavaDoc dstpath,String JavaDoc srcpath,String JavaDoc filename,String JavaDoc sshpath) {
63       this.dstuser=dstuser;
64       this.dsthost=dsthost;
65       this.dstpath=dstpath;
66       this.srcpath=srcpath;
67       this.sshpath=sshpath;
68       this.filename=filename;
69     }
70
71     /**
72      * Returns a hashcode based on the orifinal file source path.
73      * @return a hashcode identifying the file, as an <code>int</code>.
74      */

75     public int hashCode() {
76       return((srcpath+filename).hashCode());
77     }
78 }
79
Popular Tags