Package com.hdfs.user.bean

Examples of com.hdfs.user.bean.Users


  @Override
  public Users find(Users user) {
    Session session = this.getSession();
    Criteria crit = session.createCriteria(Users.class);
    crit.add(Restrictions.eq("userId", user.getUserId()));
    Users newuser = null;
    try {
      newuser = (Users) crit.uniqueResult();
    } catch (Exception e) {
      return null;
    } finally {
View Full Code Here


  @Override
  public Users findid(int userid) {
    Session session = this.getSession();
    Criteria crit = session.createCriteria(Users.class);
    crit.add(Restrictions.eq("userId", userid));
    Users newuser = null;
    try {
      newuser = (Users) crit.uniqueResult();
    } catch (Exception e) {
      return null;
    } finally {
View Full Code Here

  @Override
  public Users findByName(Users user) {
    Session session = this.getSession();
    Criteria crit = session.createCriteria(Users.class);
    crit.add(Restrictions.eq("username", user.getUsername()));
    Users newuser = null;
    try {
      newuser = (Users) crit.uniqueResult();
    } catch (Exception e) {
      return null;
    } finally {
View Full Code Here

    Session session = this.getSession();
    Criteria crit = session.createCriteria(Users.class);
    crit.add(Restrictions.eq("username", user.getUsername()));
    crit.add(Restrictions.eq("password", user.getPassword()));
    // crit.add(Restrictions.eq("active", 1));//是否激活
    Users newuser = null;
    try {
      newuser = (Users) crit.uniqueResult();
    } catch (Exception e) {
      return null;
    } finally {
View Full Code Here

    // crit.add(Restrictions.eq("username", user.getUsername()));
    crit.add(Restrictions.eq("s", 1));// 是否激活
    // System.out.println("username in the function = "+user.getUsername());
    System.out.println("checknumber in the function = "
        + user.getCheckuser());
    Users newuser = null;
    try {
      // newuser= (Users)crit.uniqueResult();
      if (user.getCheckuser() == 1) {
        newuser = user;
      } else {
View Full Code Here

    } else {
      /*
       * 根据userId找到该user在数据库中的完整记录
       */
      System.out.println("安全等级:" + getSafelevel());
      Users user = new Users();
      user.setUserId((int) userId);
      System.out.println(user.getUserId());
      user = userservice.find(user);

      /*
       * 根据用户信息,取出对应的用户空间
       */
      long memoryId = user.getMemoryId();
      HdfsMemory memory = fileservice.getMemory((int) memoryId);

      /*
       * 删除该文件,并更新用户空间的已用空间
       */
 
View Full Code Here

   * @return
   */

  public String uploadFile() {
    byte[] encryptedDataSecretKey = null; // 用来保存加密后的DES密钥
    Users user = new Users();
    user.setUserId((int) userId);
    user = userservice.find(user);

    long memoryId = user.getMemoryId();
    HdfsMemory memory = fileservice.getMemory((int) memoryId);
    int free = memory.getTotalmemory() - memory.getMemoryused();
    /*
     * 将上传的临时文件uploadFile复制到dst文件。
     */
 
View Full Code Here

       * 删除已有文件
       */
      /*
       * 根据userId找到该user在数据库中的完整记录
       */
      Users user = new Users();

      user.setUserId((int) userId);
      user = userservice.find(user);

      /*
       * 根据用户信息,取出对应的用户空间
       */
      long memoryId = user.getMemoryId();
      HdfsMemory memory = fileservice.getMemory((int) memoryId);

      /*
       * 删除该文件,并更新用户空间的已用空间
       */
 
View Full Code Here

  /**
   * 生成RSA密钥对,并保存公钥在服务器上的路径到数据库中
   */
  public String generateKeyPair() {

    Users user = new Users();
    user.setUserId((int) userId);
    user = userservice.find(user);

    try {
      fileservice.generatePublicKey(user);

View Full Code Here

    ActionContext ac = ActionContext.getContext();// 获得ActionContext
    Map app = ac.getApplication();

    String username = (String) ac.getSession().get("userName");

    user = userservice.findByName(new Users(username));
    return SUCCESS;

  }
View Full Code Here

TOP

Related Classes of com.hdfs.user.bean.Users

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.