configitemattr.d

来自「本人课程设计时做的一个用struts框架实现的基于cmmi2的项目管理系统的原型」· D 代码 · 共 91 行

D
91
字号
package com.cmmi2pms.cm;

import java.util.*;                                                        
import com.cmmi2pms.common.comdb.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.*;
/** class ConfigItemAttr.
 * it's a java bean,store the attributes of a configuration item.
 * @author LinRong
 * @version 1.0
*/
public class ConfigItemAttr
{
    
    private String itemName;
    private String itemNumber;        
    private String projectName;
    private String submiter;
    private String version;
    private String path;
    private String createDate;
    // private boolean exist;
    private SqlDB dbf = new SqlDB();
    private ResultSet rs = null;
    
    /** 
     * @param:userID,pathname
    */
    ConfigItemAttr(String name,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 + =
减小字号Ctrl + -
显示快捷键?