Package org.hive2hive.core.network.data

Examples of org.hive2hive.core.network.data.UserProfileManager


  }

  private void processSharedWithOther() throws Hive2HiveException {
    /** Add the new user to the permission list of the folder index */
    UserProfileManager profileManager = networkManager.getSession().getProfileManager();
    String pid = UUID.randomUUID().toString();
    UserProfile userProfile = profileManager.getUserProfile(pid, true);
    FolderIndex index = (FolderIndex) userProfile.getFileById(sharedIndex.getFilePublicKey());
    if (index == null) {
      throw new Hive2HiveException("I'm not the newly shared user but don't have the shared folder");
    }

    index.addUserPermissions(addedFriend);
    profileManager.readyToPut(userProfile, pid);
  }
View Full Code Here


    profileManager.readyToPut(userProfile, pid);
  }

  private void processSharedWithMe() throws Hive2HiveException {
    /** 1. add the tree to the root node in the user profile */
    UserProfileManager profileManager = networkManager.getSession().getProfileManager();
    String pid = UUID.randomUUID().toString();
    UserProfile userProfile = profileManager.getUserProfile(pid, true);

    // add it to the root (by definition)
    userProfile.getRoot().addChild(sharedIndex);
    sharedIndex.setParent(userProfile.getRoot());
    profileManager.readyToPut(userProfile, pid);
    logger.debug("Added the newly shared folder to the own user profile.");

    /** 2. Notify others that files are available */
    notifyOtherClients(new UploadNotificationMessageFactory(sharedIndex, null));
    logger.debug("Notified other client that new (shared) files are available for download.");
View Full Code Here

    // 1. download the file with new name <filename>_<date>
    // 2. add the file with an AddFileProcess (which also notifies other clients)
    try {
      // find the node at the user profile
      UserProfileManager profileManager = networkManager.getSession().getProfileManager();
      UserProfile userProfile = profileManager.getUserProfile(getID(), false);
      Index selectedNode = userProfile.getFileById(metaFileSmall.getId());
      if (selectedNode == null) {
        throw new Hive2HiveException("File node not found");
      }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.network.data.UserProfileManager

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.