⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directoryattr.d

📁 本人课程设计时做的一个用struts框架实现的基于cmmi2的项目管理系统的原型。还有部分功能尚未实现
💻 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 + -