View Javadoc

1   package twcsckernel.projectbase.io;
2   
3   import java.io.Serializable;
4   
5   /***
6    * Dekryptor istniejącego pliku zawierający nazwę, ścieżkę, rozmiar, datę
7    * modyfikacji, atrybut hidden i informację czy jest to plik czy katalog.
8    * (isFile==!isDirectory)
9    * 
10   * @author VMD Group
11   * 
12   */
13  public class FileDescriptor implements Serializable {
14  
15  	private static final long serialVersionUID = 1L;
16  
17  	String name;
18  
19  	String path;
20  
21  	long length;
22  
23  	long lastModified;
24  
25  	boolean isHidden;
26  
27  	boolean isFile;
28  
29  	/***
30  	 * @return <i>true</i> jeśli deskryptor określa plik lub <i>false</i>
31  	 *         jeśli katalog
32  	 */
33  	public boolean isFile() {
34  		return isFile;
35  	}
36  
37  	/***
38  	 * @return czy plik jest ukryty
39  	 */
40  	public boolean isHidden() {
41  		return isHidden;
42  	}
43  
44  	/***
45  	 * @return data ostatniej modyfikacji
46  	 */
47  	public long getLastModified() {
48  		return lastModified;
49  	}
50  
51  	/***
52  	 * @return rozmiar pliku (lub 0 gdy katalog)
53  	 */
54  	public long getLength() {
55  		return length;
56  	}
57  
58  	/***
59  	 * @return nazwa pliku
60  	 */
61  	public String getName() {
62  		return name;
63  	}
64  
65  	/***
66  	 * @return ścieżka do pliku bez samej nazwy
67  	 */
68  	public String getPath() {
69  		return path;
70  	}
71  
72  	public void setIsFile(boolean isFile) {
73  		this.isFile = isFile;
74  	}
75  
76  	public void setHidden(boolean isHidden) {
77  		this.isHidden = isHidden;
78  	}
79  
80  	public void setLastModified(long lastModified) {
81  		this.lastModified = lastModified;
82  	}
83  
84  	public void setLength(long length) {
85  		this.length = length;
86  	}
87  
88  	public void setName(String name) {
89  		this.name = name;
90  	}
91  
92  	public void setPath(String path) {
93  		this.path = path;
94  	}
95  
96  	public FileDescriptor(String name, String path, long length, boolean file,
97  			boolean hidden, long modified) {
98  		isFile = file;
99  		isHidden = hidden;
100 		lastModified = modified;
101 		this.length = length;
102 		this.name = name;
103 		this.path = path;
104 	}
105 
106 	public FileDescriptor() {
107 	}
108 
109 }