📄 directoryattr.d
字号:
package com.cmmi2pms.cm;
import java.util.*;
import com.cmmi2pms.common.comdb.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.*;
/** class DirectoryAttr
* it's a java bean,store the attributes of a directory
* @author LinRong
* @version 1.0
*/
public class DirectoryAttr
{
private String mode=new String("");
//relative path of this directory
private String dirName;
//absolute path of configuration repositoty
private String repositoryPath="E:\\CMP";
private String[] fileList;
private String user;
private SqlDB dbf = new SqlDB();
private ResultSet rs = null;
/**
* @param:userID,pathname
*/
DirectoryAttr(String userID,String pathname) throws SQLException,Exception
{
File path;
this.user = userID;
this.dirName = pathname;
path = new File(repositoryPath+dirName);//May be can use another method to get file list;
fileList = path.list();
/*
ADD:判断使用者的权限是否有访问此目录权限,无则mode="";
*/
dbf.setSql("select *.position from 'employee' where userid = ? ");
dbf.setString(1,user);
rs = dbf.executeQuery();
/*if ( !rs )
{
}*/
if ( rs.getString(1).equals("cc" ) )
{
mode = "R+W";
}
else
{
mode = "R";
}
}
public String[] refresh()
{
File path = new File(repositoryPath+dirName);
this.fileList = path.list();
return (this.fileList);
}
public String getdirName()
{
return (this.dirName);
}
public String getuser()
{
return (this.user);
}
public String[] getfileList()
{
return (this.fileList);
}
public String getmode()
{
return (this.mode);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -