- @Override
- protected String getUuid(URL source, InputStream in) throws IOException {
- if (tmpInfo.exists()) {
- return base.getUuid(fakeSource, getFakeInput());
- }
+ if (entry.getName().equals(getDataPrefix() + "version")) {
+ // Nothing to do for now ("first"
+ // version is 3.0)
+ } else if (entryLName.endsWith(".info")) {
+ // Info file
+ IOUtils.write(zipIn, tmpInfo);
+ } else if (imageEntry) {
+ // Cover
+ if (getCover()) {
+ try {
+ cover = new Image(zipIn);
+ } catch (Exception e) {
+ Instance.getTraceHandler().error(e);
+ }
+ }
+ } else if (entry.getName().equals(getDataPrefix() + "URL")) {
+ String[] descArray = StringUtils
+ .unhtml(IOUtils.readSmallStream(zipIn)).trim()
+ .split("\n");
+ if (descArray.length > 0) {
+ url = descArray[0].trim();
+ }
+ } else if (entry.getName().equals(
+ getDataPrefix() + "SUMMARY")) {
+ String[] descArray = StringUtils
+ .unhtml(IOUtils.readSmallStream(zipIn)).trim()
+ .split("\n");
+ int skip = 0;
+ if (descArray.length > 1) {
+ title = descArray[0].trim();
+ skip = 1;
+ if (descArray.length > 2
+ && descArray[1].startsWith("©")) {
+ author = descArray[1].substring(1).trim();
+ skip = 2;
+ }
+ }
+ this.desc = "";
+ for (int i = skip; i < descArray.length; i++) {
+ this.desc += descArray[i].trim() + "\n";
+ }