Meta
    public static Document Document(File f)            throws java.io.FileNotFoundException {Meta        Document doc = new Document();        doc.add(Field.Keyword("path", f.getPath()));        String path = f.getParent();        // path = path.substring(0, path.length() - 1);        doc.add(Field.Keyword("absolutepath", path));        doc.add(Field.Keyword("name", f.getName()));        doc.add(Field.Text("type", "image"));        ImageIcon tmpicon = new ImageIcon(f.getPath());        doc.add(Field.Text("image-width", String.valueOf(tmpicon.getIconWidth())));        doc.add(Field.Text("image-height", String.valueOf(tmpicon.getIconHeight())));        try {           BASE64Encoder b64E = new BASE64Encoder();           String encoded = b64E.encode(generateThumbnail(f.getPath()));           doc.add(Field.UnIndexed("thumbnail",encoded));        } catch (ImageFormatException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        } catch (InterruptedException e) {            e.printStackTrace();        }        doc.add(Field.Keyword("modified", DateField.timeToString(f                .lastModified())));        return doc;    }