html files encryption for client side

泪湿孤枕 提交于 2019-12-11 05:14:38

问题


I am using lucene for indexing and searching on client side after searching the keyword i want to display the html files there . So is there any way to store and access the html files . actually the html files are storing images and links and they should be opened in the java api as normal html file . I am using the following code for lucene indexing

  try
  {

        IndexWriter indexWriter = new IndexWriter(

        FSDirectory.open(indexDir),

        new SimpleAnalyzer(),

        true,
        IndexWriter.MaxFieldLength.LIMITED);
        indexWriter.setUseCompoundFile(false);
        indexDirectory(indexWriter, dataDir, suffix);

        Document doc = new Document();

        doc.add(new Field("contents", new FileReader(f))); 

        doc.add(new Field("filename",f.getCanonicalPath(),

        Field.Store.YES,Field.Index.ANALYZED));
        indexWriter.addDocument(doc);

        numIndexed = indexWriter.maxDoc();

        indexWriter.optimize();

        indexWriter.close();

        } 

        catch(Exception ex)
        {
        }

How should i display the html files matching the search criteria on client side


回答1:


You may be looking for browse(), which "Launches the default browser to display a URI." Alternatively, an editor pane can be used, although support is limited.



来源:https://stackoverflow.com/questions/12679195/html-files-encryption-for-client-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!