Subversion Repositories XServices

Rev

Rev 92 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 116
Line -... Line 1...
-
 
1
/*
-
 
2
 *   Copyright 2013 Brian Rosenberger (Brutex Network)
-
 
3
 *
-
 
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
-
 
5
 *   you may not use this file except in compliance with the License.
-
 
6
 *   You may obtain a copy of the License at
-
 
7
 *
-
 
8
 *       http://www.apache.org/licenses/LICENSE-2.0
-
 
9
 *
-
 
10
 *   Unless required by applicable law or agreed to in writing, software
-
 
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
-
 
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
13
 *   See the License for the specific language governing permissions and
-
 
14
 *   limitations under the License.
-
 
15
 */
-
 
16
 
1
package net.brutex.xservices.types;
17
package net.brutex.xservices.types;
Line 2... Line 18...
2
 
18
 
3
import java.io.File;
-
 
4
 
19
import java.io.File;
5
import javax.xml.bind.annotation.XmlElement;
20
import javax.xml.bind.annotation.XmlElement;
-
 
21
import javax.xml.bind.annotation.XmlRootElement;
6
import javax.xml.bind.annotation.XmlRootElement;
22
/**
-
 
23
 * @author Brian Rosenberger, bru(at)brutex.de
-
 
24
 *
Line 7... Line -...
7
import javax.xml.bind.annotation.XmlType;
-
 
8
 
-
 
Line -... Line 25...
-
 
25
 */
-
 
26
 
-
 
27
 
-
 
28
 
9
@XmlRootElement
29
@XmlRootElement
10
public class FileInfoType {
30
public class FileInfoType
11
 
31
{
12
	private String name;
32
  private String name;
13
	private String path;
33
  private String path;
14
	private long filesize;
34
  private long filesize;
15
	private boolean canWrite;
35
  private boolean canWrite;
-
 
36
  private boolean isDirectory;
16
	private boolean isDirectory;
37
 
17
	
38
  public FileInfoType()
18
	public FileInfoType() {
39
  {
-
 
40
  }
19
	}
41
 
20
	
42
  public FileInfoType(File file)
21
	public FileInfoType(File file) {
43
  {
22
		this.name = file.getName();
44
    this.name = file.getName();
23
		this.path = file.getAbsolutePath().replace('\\', '/');
45
    this.path = file.getAbsolutePath().replace('\\', '/');
-
 
46
    this.canWrite = file.canWrite();
24
		this.canWrite = file.canWrite();
47
    this.filesize = file.length();
25
		this.filesize = file.length();
-
 
26
		this.isDirectory = file.isDirectory();	}
-
 
27
 
-
 
28
	/**
48
    this.isDirectory = file.isDirectory();
29
	 * @return the name
49
  }
-
 
50
 
30
	 */
51
  @XmlElement(name="name")
31
	@XmlElement(name="name")
52
  public String getName()
32
	public String getName() {
53
  {
33
		return name;
-
 
34
	}
54
    return this.name;
35
 
55
  }
36
	/**
-
 
37
	 * @param name the name to set
56
 
38
	 */
57
  public void setName(String name)
39
	public void setName(String name) {
58
  {
40
		this.name = name;
-
 
41
	}
-
 
42
 
-
 
43
	/**
59
    this.name = name;
44
	 * @return the path
60
  }
-
 
61
 
45
	 */
62
  @XmlElement(name="path")
46
	@XmlElement(name="path")
63
  public String getPath()
47
	public String getPath() {
64
  {
48
		return path;
-
 
49
	}
65
    return this.path;
50
 
66
  }
51
	/**
-
 
52
	 * @param path the path to set
67
 
53
	 */
68
  public void setPath(String path)
54
	public void setPath(String path) {
69
  {
55
		this.path = path;
-
 
56
	}
-
 
57
 
-
 
58
	/**
70
    this.path = path;
59
	 * @return the filesize
71
  }
-
 
72
 
60
	 */
73
  @XmlElement(name="size")
61
	@XmlElement(name="size")
74
  public long getFilesize()
62
	public long getFilesize() {
75
  {
63
		return filesize;
-
 
64
	}
76
    return this.filesize;
65
 
77
  }
66
	/**
-
 
67
	 * @param filesize the filesize to set
78
 
68
	 */
79
  public void setFilesize(long filesize)
69
	public void setFilesize(long filesize) {
80
  {
70
		this.filesize = filesize;
-
 
71
	}
-
 
72
 
-
 
73
	/**
81
    this.filesize = filesize;
74
	 * @return the canWrite
82
  }
-
 
83
 
75
	 */
84
  @XmlElement(name="isWritable")
76
	@XmlElement(name="isWritable")
85
  public boolean isCanWrite()
77
	public boolean isCanWrite() {
86
  {
78
		return canWrite;
-
 
79
	}
-
 
80
 
-
 
81
	/**
87
    return this.canWrite;
82
	 * @return the isDirectory
88
  }
-
 
89
 
83
	 */
90
  @XmlElement(name="isDirectory")
84
	@XmlElement(name="isDirectory")
91
  public boolean isDirectory()
85
	public boolean isDirectory() {
-
 
86
		return isDirectory;
-
 
87
	}
-
 
88
	
92
  {
89
	
93
    return this.isDirectory;