Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
92 brianR 1
package net.brutex.xservices.types;
2
 
3
import java.io.File;
4
 
5
import javax.xml.bind.annotation.XmlElement;
6
import javax.xml.bind.annotation.XmlRootElement;
7
import javax.xml.bind.annotation.XmlType;
8
 
9
@XmlRootElement
10
public class FileInfoType {
11
 
12
	private String name;
13
	private String path;
14
	private long filesize;
15
	private boolean canWrite;
16
	private boolean isDirectory;
17
 
18
	public FileInfoType() {
19
	}
20
 
21
	public FileInfoType(File file) {
22
		this.name = file.getName();
23
		this.path = file.getAbsolutePath().replace('\\', '/');
24
		this.canWrite = file.canWrite();
25
		this.filesize = file.length();
26
		this.isDirectory = file.isDirectory();	}
27
 
28
	/**
29
	 * @return the name
30
	 */
31
	@XmlElement(name="name")
32
	public String getName() {
33
		return name;
34
	}
35
 
36
	/**
37
	 * @param name the name to set
38
	 */
39
	public void setName(String name) {
40
		this.name = name;
41
	}
42
 
43
	/**
44
	 * @return the path
45
	 */
46
	@XmlElement(name="path")
47
	public String getPath() {
48
		return path;
49
	}
50
 
51
	/**
52
	 * @param path the path to set
53
	 */
54
	public void setPath(String path) {
55
		this.path = path;
56
	}
57
 
58
	/**
59
	 * @return the filesize
60
	 */
61
	@XmlElement(name="size")
62
	public long getFilesize() {
63
		return filesize;
64
	}
65
 
66
	/**
67
	 * @param filesize the filesize to set
68
	 */
69
	public void setFilesize(long filesize) {
70
		this.filesize = filesize;
71
	}
72
 
73
	/**
74
	 * @return the canWrite
75
	 */
76
	@XmlElement(name="isWritable")
77
	public boolean isCanWrite() {
78
		return canWrite;
79
	}
80
 
81
	/**
82
	 * @return the isDirectory
83
	 */
84
	@XmlElement(name="isDirectory")
85
	public boolean isDirectory() {
86
		return isDirectory;
87
	}
88
 
89
 
90
 
91
}