Open GoogleCodeExporter opened 8 years ago
Original comment by gk5...@kickstyle.net
on 6 Jan 2010 at 4:40
Also reproduced on Windows XP (java full version "1.6.0_11-b03"), export failed
at
the first JPG attachment
java -cp google-sites-liberation-1.0.1.jar
com.google.sites.liberation.export.Main -
w mysite -u myname -p ******** -f e:\temp\1 -r > liberation.log 2>&1
...
Current progress: 77%.
Downloading attachment: DSC_1498.JPG.
Exception in thread "main" java.lang.ClassCastException:
com.google.gdata.data.sites.AttachmentEntry cannot be cast to
com.google.gdata.data.sites.BasePageEntry
at com.google.sites.liberation.export.InMemoryEntryStore.getParent
(InMemoryEntryStore.java:101)
at com.google.sites.liberation.export.SiteExporterImpl.downloadAttachment
(SiteExporterImpl.java:174)
at com.google.sites.liberation.export.SiteExporterImpl.exportSite
(SiteExporterImpl.java:142)
at com.google.sites.liberation.export.Main.doMain(Main.java:81)
at com.google.sites.liberation.export.Main.main(Main.java:97)
Original comment by smishc...@gmail.com
on 7 Jan 2010 at 9:52
It sounds strange, but parent of AttachmentEntry is not necessarily PageEntry.
Sometimes great URLs occur, like this:
http://sites.google.com/site/mysite/notes/note200/DSC_1496.JPG/DSC_1498.JPG
(one
attachment and then another). Their origination is obscure for me, but it
seems,
they have to do with versioned attachments. I suppose, it may be some
architectural
flaw in Google Sites, sometimes browsing through such pages leads to 404 error.
I suggest for now: simply catch an exception at
com.google.sites.liberation.export.SiteExporterImpl.java (at least, in this
case
export completes, and it seems, all attachments are here, I am not quite shure
about
latest versions)
for (AttachmentEntry attachment : attachments) {
progressListener.setStatus("Downloading attachment: "
+ attachment.getTitle().getPlainText() + '.');
try {
downloadAttachment(attachment, rootDirectory, entryStore,
sitesService);
} catch (Exception ex) {
progressListener.setStatus("Error downloading attachment "
+ attachment.getTitle().getPlainText() + " : " +
ex.toString() + '.');
}
progressListener.setProgress(((double) ++currentEntries) / totalEntries);
}
Original comment by smishc...@gmail.com
on 24 Jan 2010 at 1:18
Attachments:
Original issue reported on code.google.com by
agent...@gmail.com
on 8 Dec 2009 at 7:43