Subversion Repositories XServices

Rev

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

Rev Author Line No. Line
116 brianR 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
 
92 brianR 17
package net.brutex.xservices.types;
18
 
19
import java.io.File;
20
import javax.xml.bind.annotation.XmlElement;
21
import javax.xml.bind.annotation.XmlRootElement;
116 brianR 22
/**
23
 * @author Brian Rosenberger, bru(at)brutex.de
24
 *
25
 */
92 brianR 26
 
116 brianR 27
 
28
 
92 brianR 29
@XmlRootElement
116 brianR 30
public class FileInfoType
31
{
32
  private String name;
33
  private String path;
34
  private long filesize;
35
  private boolean canWrite;
36
  private boolean isDirectory;
92 brianR 37
 
116 brianR 38
  public FileInfoType()
39
  {
40
  }
92 brianR 41
 
116 brianR 42
  public FileInfoType(File file)
43
  {
44
    this.name = file.getName();
45
    this.path = file.getAbsolutePath().replace('\\', '/');
46
    this.canWrite = file.canWrite();
47
    this.filesize = file.length();
48
    this.isDirectory = file.isDirectory();
49
  }
92 brianR 50
 
116 brianR 51
  @XmlElement(name="name")
52
  public String getName()
53
  {
54
    return this.name;
55
  }
92 brianR 56
 
116 brianR 57
  public void setName(String name)
58
  {
59
    this.name = name;
60
  }
92 brianR 61
 
116 brianR 62
  @XmlElement(name="path")
63
  public String getPath()
64
  {
65
    return this.path;
66
  }
92 brianR 67
 
116 brianR 68
  public void setPath(String path)
69
  {
70
    this.path = path;
71
  }
92 brianR 72
 
116 brianR 73
  @XmlElement(name="size")
74
  public long getFilesize()
75
  {
76
    return this.filesize;
77
  }
92 brianR 78
 
116 brianR 79
  public void setFilesize(long filesize)
80
  {
81
    this.filesize = filesize;
82
  }
92 brianR 83
 
116 brianR 84
  @XmlElement(name="isWritable")
85
  public boolean isCanWrite()
86
  {
87
    return this.canWrite;
88
  }
89
 
90
  @XmlElement(name="isDirectory")
91
  public boolean isDirectory()
92
  {
93
    return this.isDirectory;
94
  }
95
}