Statistics
| Branch: | Revision:

root / src / com / rackspace / cloud / files / api / client / ObjectVersion.java @ 08922f29

History | View | Annotate | Download (861 Bytes)

1
package com.rackspace.cloud.files.api.client;
2

    
3
import java.io.Serializable;
4
import java.text.SimpleDateFormat;
5
import java.util.Date;
6

    
7
public class ObjectVersion implements Serializable{
8
        String name;
9
        String timestamp;
10
        int version;
11
        
12
        
13
        
14
        public String getName() {
15
                return name;
16
        }
17
        public void setName(String name) {
18
                this.name = name;
19
        }
20
        public String getTimestamp() {
21
                return timestamp;
22
        }
23
        public void setTimestamp(String timestamp) {
24
                this.timestamp = timestamp;
25
        }
26
        public int getVersion() {
27
                return version;
28
        }
29
        public void setVersion(int version) {
30
                this.version = version;
31
        }
32
        
33
        
34
        public Date getVersionDate(){
35
                return new Date((long) (Double.parseDouble(getTimestamp()) * 1000));
36
        }
37
        
38
        public String getDateString(){
39
                SimpleDateFormat formatter = new SimpleDateFormat("d/M/yyyy h:mm a");
40
                return formatter.format(getVersionDate());
41
        }
42
        
43
}