filedocument.java

来自「反ajax原代码」· Java 代码 · 共 30 行

JAVA
30
字号
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   FileDocument.java

package com.laoer.bbscs.lucene;

import java.io.*;
import org.apache.lucene.document.*;

public class FileDocument
{

    public static Document Document(File f)
        throws FileNotFoundException
    {
        Document doc = new Document();
        doc.add(Field.Text("path", f.getPath()));
        doc.add(Field.Keyword("modified", DateField.timeToString(f.lastModified())));
        FileInputStream is = new FileInputStream(f);
        java.io.Reader reader = new BufferedReader(new InputStreamReader(is));
        doc.add(Field.Text("contents", reader));
        return doc;
    }

    private FileDocument()
    {
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?