急求Java简单文件管理类程序

来源:百度知道 编辑:UC知道 时间:2024/06/06 18:25:30
基本功能:
1)、能实现建立新文件、打开、读出、写入、关闭文件操作;
2)、文本文件的分页显示;
3)、文件的拷贝(可增加对指定文件名、扩展名、日期、时间等的文件进行);
4)、文件的删除;
5)、 退出;

这是别人写好的

package sunnykid.file;

import java.io.*;
import sunnykid.text.SunnykidNumber;

/**
* <p>标题: JAVA文件操作工具类</p>
* <br>
* <p>描述: 阳光软体工作室常用工具包</p>
* <br>
* <p>版权: 版权所有 (c) 2007</p>
* <br>
* <p>组织: 阳光软体工作室</p>
*
* @author 钟晓籁
* @version V1.0
*/
public class FileOperator {

/**
* 不带参数的构造函数
*/
public FileOperator() {
super();
}

/**
* 删除指定的文件
* @param filepath String 待删除的文件路径及名称
* @throws IOException
*/
public void delete(String filepath) throws IOException {
Runtime rt = Runtime.getRuntime();
rt.exec("cmd /c del " + filepath);
}

/**
* 将字符串写入文件
* @param content String 待写入的字符串内容
* @param filepath Str