package cn.sdeit.file;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Scanner;
public class ReadTxt
{
private int id;
public String getArticle(String path,int id)
{
String url = path+id+".txt";
String string = "";
String allString = "";
File file=new File(url);
try
{
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file),"utf-8"));
while((string=reader.readLine())!=null)
{
allString += string+"\r\n";
}
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
return allString;
}
}