Revision 580478e1

b/web_client/src/gr/grnet/pithos/web/client/FileList.java
297 297
        aColumn = new Column<File,String>(new TextCell()) {
298 298
			@Override
299 299
			public String getValue(File object) {
300
				return formatter.format(object.getLastModified());
300
				return object.getLastModified() != null ? formatter.format(object.getLastModified()) : "";
301 301
			}
302 302
		};
303 303
        aheader = new SortableHeader("Last Modified");
......
500 500
                            } else if (sortingProperty.equals("owner")) {
501 501
                                    return arg0.getOwner().compareTo(arg1.getOwner());
502 502
                            } else if (sortingProperty.equals("date")) {
503
                                    return arg0.getLastModified().compareTo(arg1.getLastModified());
503
                            		if (arg0.getLastModified() != null && arg1.getLastModified() != null)
504
                            			return arg0.getLastModified().compareTo(arg1.getLastModified());
505
                            		return 0;
504 506
                            } else if (sortingProperty.equals("size")) {
505 507
                                    return (int) (arg0.getBytes() - arg1.getBytes());
506 508
                            } else if (sortingProperty.equals("name")) {
b/web_client/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java
216 216
        generalTable.setText(2, 1, file.getOwner());
217 217

  
218 218
        final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
219
        generalTable.setText(3, 1, formatter.format(file.getLastModified()));
219
        generalTable.setText(3, 1, file.getLastModified() != null ? formatter.format(file.getLastModified()) : "");
220 220

  
221 221
		StringBuffer tagsBuffer = new StringBuffer();
222 222
        for (String t : file.getTags())
b/web_client/src/gr/grnet/pithos/web/client/foldertree/Folder.java
43 43
import java.util.Map;
44 44
import java.util.Set;
45 45

  
46
import com.google.gwt.core.client.GWT;
46 47
import com.google.gwt.http.client.Response;
47 48
import com.google.gwt.i18n.client.DateTimeFormat;
48 49
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
......
105 106
        return bytesUsed;
106 107
    }
107 108

  
108
    public void setLastModified(Date lastModified) {
109
        this.lastModified = lastModified;
110
    }
111

  
112 109
    public Set<Folder> getSubfolders() {
113 110
        return subfolders;
114 111
    }
......
156 153
        this.owner = _owner;
157 154
        String header = response.getHeader("Last-Modified");
158 155
        if (header != null)
159
            lastModified = DateTimeFormat.getFormat(PredefinedFormat.RFC_2822).parse(header);
156
			try {
157
				lastModified = DateTimeFormat.getFormat(PredefinedFormat.RFC_2822).parse(header);
158
			} catch (IllegalArgumentException e) {
159
				GWT.log("Last-Modified will be set to null", e);
160
				lastModified = null;
161
			}
160 162

  
161 163
        header = response.getHeader("X-Container-Bytes-Used");
162 164
        if (header != null && header.length() > 0)
b/web_client/src/gr/grnet/pithos/web/client/foldertree/Resource.java
35 35

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

  
38
import com.google.gwt.core.client.GWT;
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;
......
84 85
        if(obj.get(key) != null) {
85 86
            JSONString s = obj.get(key).isString();
86 87
            if (s != null)
87
                return DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(s.stringValue());
88
				try {
89
					return DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(s.stringValue());
90
				} catch (IllegalArgumentException e) {
91
					GWT.log("", e);
92
				}
88 93
        }
89 94
        return null;
90 95
    }

Also available in: Unified diff