Package unibg.overencrypt.core

Examples of unibg.overencrypt.core.DownloadManager


          {
            if(firstFile){  //If first file retrieve AES Key

              if(ServerConfiguration.debug)
                JOptionPane.showMessageDialog(null, "EDIT PERMISSIONS - SEL. oldAclSEL: " + oldAclSEL + "\nFileID: " + fileID );
              DownloadManager downloadManager = new DownloadManager();
              SessionManager.saveSession(userWhoMakeRequest, downloadManager);
              downloadManager.setAcl(oldAclSEL);
              downloadManager.setDownloadManager(fileID, false, "0", "0");
              String IdToken = downloadManager.getID();
             
              if(ServerConfiguration.debug)
                JOptionPane.showMessageDialog(null, "EDIT PERMISSIONS - SEL. TokenID = " + IdToken);

              boolean firstStep = true;
              String nextToken = "";
              String jsonPath = ServerConfiguration.getTempFilePath() + "/" + tempFileName + "_json.txt";
              String nextPath = ServerConfiguration.getTempFilePath() + "/" + tempFileName + "_next.txt";
              aesKeyPath = ServerConfiguration.getTempFilePath() + "/" + tempFileName + "_AESKey.txt";

              boolean destinationACLReached;
              do{
                String json = downloadManager.createJson(nextToken,firstStep);
                if(ServerConfiguration.debug)
                  JOptionPane.showMessageDialog(null, "JSON importante: " + json);
                //write json.txt
                FileSystemUtils.writeFile(jsonPath, json);
                //FileUtility.writeFile(jsonPath, json);
                if(ServerConfiguration.debug)
                  JOptionPane.showMessageDialog(null, "controlla se esiste il file json - firstStep = " + firstStep);

                if(firstStep == true)
                {
                  //run wpes1
                  String command[] = {
                      ServerConfiguration.getEXECUTABLES_PATH() + "/wpes1_linux",
                      "dec1",
                      jsonPath,
                      PIN,
                      aesKeyPath,
                      IdToken,
                      nextPath
                  };
                  RunnerExecutables.execute(command);

                  firstStep = false;
                }
                else
                {
                  //run wpes1
                  String command[] = {
                      ServerConfiguration.getEXECUTABLES_PATH() + "/wpes1_linux",
                      "decn",
                      jsonPath,
                      aesKeyPath,
                      aesKeyPath,
                      IdToken,
                      nextPath
                  };
                  RunnerExecutables.execute(command);
                }

                //read next.txt
                if(ServerConfiguration.debug)
                  JOptionPane.showMessageDialog(null, "Ora legge nextPath");
                nextToken = FileSystemUtils.readFile(nextPath);
                //nextToken = FileUtility.readFile(nextPath);


                destinationACLReached = downloadManager.finished(nextToken);


                //remove Json.txt file from temp because the file is used
                //only by the executable and it will rewrite
                FileUtility.deleteTempFile(jsonPath);
View Full Code Here


      ownerID = "0";
    }else{
      level = true;
    }

    SessionManager.saveSession(userID, new DownloadManager());
    try {
      DownloadManager downloadManager = SessionManager.getDownloadManager(userID);
      downloadManager.setAcl(acl);
      downloadManager.setDownloadManager(fileID, level, userID, ownerID);

      //Return token ID
      response = OverEncryptResponse.generateResponse(ServerPrimitives.OE_GET_TOKEN_ID, request.getParent(), downloadManager.getID());
    } catch (Exception e) {
      errorReason = "Exception while retrieving unibg.overencrypt.core.downloadManager";
      LOGGER.error(errorReason,e);
      response = OverEncryptResponse.generateResponse(ServerPrimitives.OE_ERROR, request.getParent(), errorReason);
    }   
View Full Code Here

TOP

Related Classes of unibg.overencrypt.core.DownloadManager

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.