Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to extract Lotus Notes database icon?
    text
    copied!<p>I have tried to extract Lotus Notes database icon by using DXL Exporter but it is not success. Result file is corrupt and can not be opened by image viewer.</p> <p>How can I extract Lotus Notes database icon by using java?</p> <pre><code>private String extractDatabaseIcon() { String tag = ""; String idfile = ""; String password = ""; String dbfile = ""; NotesThread.sinitThread(); Session s = NotesFactory.createSessionWithFullAccess(); s.createRegistration().switchToID(idfile, password); Database d = s.getDatabase("", dbfile); NoteCollection nc = d.createNoteCollection(false); nc.setSelectIcon(true); nc.buildCollection(); String noteId = nc.getFirstNoteID(); int counter = 0; while (noteId != null) { counter++; try { Document doc = d.getDocumentByID(noteId); DxlExporter dxl = s.createDxlExporter(); String xml = dxl.exportDxl(doc); xml = xml.substring(xml.indexOf("&lt;note ")); org.jsoup.nodes.Document jdoc = Jsoup.parse(xml); Element ele = jdoc.select("rawitemdata").first(); String raw = ele.text().trim(); String temp = System.getProperty("java.io.tmpdir") + UUID.randomUUID().toString() + "\\"; File file = new File(temp); file.mkdir(); String filename = temp + UUID.randomUUID().toString().replaceAll("-", "") + ".gif"; byte[] buffer = decode(raw.getBytes()); FileOutputStream fos = new FileOutputStream(filename); fos.write(buffer); fos.close(); tag = filename; } catch (Exception e) { logger.error("", e); } if (counter &gt;= nc.getCount()) { noteId = null; } else { noteId = nc.getNextNoteID(noteId); } } return tag; } private byte[] decode(byte[] b) throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(b); InputStream b64is = MimeUtility.decode(bais, "base64"); byte[] tmp = new byte[b.length]; int n = b64is.read(tmp); byte[] res = new byte[n]; System.arraycopy(tmp, 0, res, 0, n); return res; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload