Debugging aid.

This commit is contained in:
Knut Forkalsrud 2014-01-04 16:21:22 -08:00
parent 70c928b703
commit 83b02293af
2 changed files with 13 additions and 0 deletions

View file

@ -8,6 +8,8 @@ package org.forkalsrud.album.exif;
import java.io.File;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* Represents one item inside the album, typically file or directory, aka photo or album
@ -125,4 +127,11 @@ public abstract class Entry {
public boolean groupByYear() {
return false;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}

View file

@ -387,6 +387,7 @@ public class AlbumServlet
out.println(" \"contents\": [");
int n = 0;
for (Entry e : entry.getContents()) {
try {
if (n++ > 0) out.println(",");
out.println(" {");
out.println(" \"name\": " + jsStr(e.getName()) + ",");
@ -397,6 +398,9 @@ public class AlbumServlet
out.println(" \"height\": " + e.getThumbnail().getSize().getHeight() + ",");
out.println(" \"caption\": " + jsStr(e.getCaption()));
out.print(" }");
} catch (Exception ex) {
throw new Exception(e.toString(), ex);
}
}
out.println();
out.println(" ]");