Revision ef5b664d src/gr/grnet/pithos/web/client/foldertree/File.java

b/src/gr/grnet/pithos/web/client/foldertree/File.java
35 35

  
36 36
package gr.grnet.pithos.web.client.foldertree;
37 37

  
38
import com.google.gwt.http.client.Header;
38 39
import com.google.gwt.http.client.Response;
39 40
import com.google.gwt.i18n.client.DateTimeFormat;
40 41
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
......
42 43
import com.google.gwt.json.client.JSONObject;
43 44
import com.google.gwt.json.client.JSONParser;
44 45
import com.google.gwt.json.client.JSONValue;
46
import java.io.StringWriter;
47
import java.security.Key;
45 48
import java.util.Date;
49
import java.util.HashSet;
50
import java.util.Set;
46 51

  
47 52
public class File extends Resource {
48 53
    private String name;
......
71 76

  
72 77
    private Folder parent;
73 78

  
79
    private Set<String> tags = new HashSet<String>();
80

  
74 81
    public String getContentType() {
75 82
        return contentType;
76 83
    }
......
149 156
        modifiedBy = unmarshallString(o, "modified_by");
150 157
        versionTimestamp = unmarshallDate(o, "version_timestamp");
151 158
        this.container = container;
159

  
160
        for (String key : o.keySet())
161
            if (key.startsWith("x_object_meta_") && !key.equals("x_object_meta_trash"))
162
                tags.add(key.substring("x_object_meta_".length()).trim().toLowerCase());
152 163
    }
153 164

  
154 165
    public boolean equals(Object other) {
......
173 184
    }
174 185

  
175 186
    private void populate(Response response) {
187
        for (Header h : response.getHeaders()) {
188
            String header = h.getName();
189
            if (header.startsWith("X-Object-Meta-") && !header.equals("X-Object-Meta-Trash"))
190
                tags.add(header.substring("X-Object-Meta-".length()).trim().toLowerCase());
191

  
192
        }
176 193
        String header = response.getHeader("X-Object-Meta-Trash");
177 194
        if (header != null)
178 195
            inTrash = Boolean.valueOf(header);
......
186 203
    public Folder getParent() {
187 204
        return parent;
188 205
    }
206

  
207
    public Set<String> getTags() {
208
        return tags;
209
    }
189 210
}

Also available in: Unified diff