View Javadoc

1   package ch.busyboxes.agoo.controller.model;
2   
3   import java.util.Date;
4   
5   import ch.busyboxes.agoo.model.enumeration.WatchedFileState;
6   
7   /**
8    * A representation of a file watched by the Agoo system, this representation contains what
9    * needs to be displayed in a view
10   * 
11   * @author julien@busyboxes.ch
12   */
13  public class WebWatchedFile {
14  
15  	/** The id of the file */
16  	private Long id;
17  
18  	/** The file name of the file relative to the watched folder */
19  	private String filename;
20  	
21  	/** The md5 hash for this file */
22  	private String md5Hash;
23  	
24  	/** The last check value */
25  	private Date lastCheck;
26  	
27  	/** The state of this file */
28  	private WatchedFileState watchedFileState;
29  	
30  	/** The folder associated with this file */
31  	private WebWatchedFolder watchedFolder;
32  	
33  	/**
34  	 * Returns the id of the watched file
35  	 * 
36  	 * @return the id of the watched file
37  	 */
38  	public Long getId() {
39  		return id;
40  	}
41  
42  	/**
43  	 * Returns the file name relative to the folder
44  	 * 
45  	 * @return the filename
46  	 */
47  	public String getFilename() {
48  		return filename;
49  	}
50  
51  	/**
52  	 * Sets the file name for this file
53  	 * 
54  	 * @param filename the file name to set
55  	 */
56  	public void setFilename(String filename) {
57  		this.filename = filename;
58  	}
59  
60  	/**
61  	 * Returns the md5 hash for this file
62  	 * 
63  	 * @return the md5Hash for this file
64  	 */
65  	public String getMd5Hash() {
66  		return md5Hash;
67  	}
68  
69  	/**
70  	 * Sets the md5 hash for this files
71  	 * 
72  	 * @param md5Hash the md5 hash to set
73  	 */
74  	public void setMd5Hash(String md5Hash) {
75  		this.md5Hash = md5Hash;
76  	}
77  
78  	/**
79  	 * Returns the last check date for this file
80  	 * 
81  	 * @return the lastCheck the last date
82  	 */
83  	public Date getLastCheck() {
84  		return lastCheck;
85  	}
86  
87  	/**
88  	 * Sets the last check date for this file
89  	 * 
90  	 * @param lastCheck the last check date to set
91  	 */
92  	public void setLastCheck(Date lastCheck) {
93  		this.lastCheck = lastCheck;
94  	}
95  
96  	/**
97  	 * Rerurns he folder containing this file
98  	 * 
99  	 * @return the watchedFolder the associated folder
100 	 */
101 	public WebWatchedFolder getWatchedFolder() {
102 		return watchedFolder;
103 	}
104 
105 	/**
106 	 * Sets the associated folder to this file
107 	 * 
108 	 * @param watchedFolder the watchedFolder to set
109 	 */
110 	public void setWatchedFolder(WebWatchedFolder watchedFolder) {
111 		this.watchedFolder = watchedFolder;
112 	}
113 
114 	/**
115 	 * Sets the id
116 	 * 
117 	 * @param id the id to set
118 	 */
119 	public void setId(Long id) {
120 		this.id = id;
121 	}
122 
123 	/**
124 	 * Get the watched file state
125 	 * 
126 	 * @return the watchedFileState
127 	 */
128 	public WatchedFileState getWatchedFileState() {
129 		return watchedFileState;
130 	}
131 
132 	/**
133 	 * Sets the watched file state
134 	 * 
135 	 * @param watchedFileState the watchedFileState to set
136 	 */
137 	public void setWatchedFileState(WatchedFileState watchedFileState) {
138 		this.watchedFileState = watchedFileState;
139 	}
140 }