高手,您好:
我是一名学习软件工程的学生,现在,我正在做我的第一个Java作品。
希望得到高手的点拨:
下面我写的这个“查找本地文件”的代码:
package c_port_package;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
public class CheckAndConfirmworker {
static C_port_Our_honor fileDS = null;
HashMap<String,String> fileset = null;
static ArrayList<String> thecommonfruitPath = new ArrayList<String>();
static ArrayList<String> thevideofruitPath = new ArrayList<String>();
static ArrayList<String> thecommonfruitFullname = new ArrayList<String>();
static ArrayList<String> thecommonfruitExtenName = new ArrayList<String>();
static ArrayList<String> thecommonfruitpreName = new ArrayList<String>();
static ArrayList<String> thecommonvideoExtenName = new ArrayList<String>();
static ArrayList<String> thevideoFullName = new ArrayList<String>();
static ArrayList<String> thevideofruitpreName = new ArrayList<String>();
static ArrayList<String> thevideofruitFullName = new ArrayList<String>();
static ArrayList<String> thevideofruitExtenName = new ArrayList<String>();
static int calc0 = 0;
static int calc1 = 0;
static File file = new File("D:\\");
static int j = 0;
static int t = 1;
//获取文件扩展名
public static String getExtensionName(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot >-1) && (dot < (filename.length() - 1))) {
return filename.substring(dot + 1);
}
}
return filename;