/**
   * Method to fill the JSON with the experiment information. This JSON includes the files field.
   *
   * @param json Input JSON to fill with data.
   * @param zipPath Path of the temporary zip files for the Experiment.
   * @return String with the new JSON.
   * @throws IOException
   */
  private String getJSONExperiment(String json, String zipPath) throws IOException {
    // Get bioID
    json += "\"id\":\"" + selExp.getBioID() + "\"";
    // Set zip file
    Path path = FileSystems.getDefault().getPath(zipPath);
    json += ",\"file\":\"" + new String(Base64Coder.encode(Files.readAllBytes(path))) + "\"}";

    return json;
  }
  /**
   * Method to save the selected Experiment, in xml and xls (if possible), in a temporary folder.
   * The files will be contained inside a zip.
   *
   * @return String with the path of the zip file.
   * @throws IOException
   */
  private String saveExpInTempFolder() throws IOException {
    String toRet = "";

    // Create temporary File
    String filePath = Files.createTempDirectory("").toString() + "/";
    filePath = filePath.replace("\\", "/");

    // Get bioID
    String bioID = selExp.getBioID();
    if (bioID.isEmpty()) {
      bioID = "bio_";
    }

    DataToFile.saveXMLData(selExp, filePath + "xml");
    // Only save in XLS if the Experiment is an IntraExperiment
    if (!isInter) {
      DataToFile.saveXLSData(selExp, filePath + "xls");
    }

    // Generate ZIP file with Java 7
    Map<String, String> zipProperties = new HashMap<>();
    zipProperties.put("create", "true");
    zipProperties.put("encoding", "UTF-8");

    // Create zip file
    URI zipDisk;
    toRet = filePath + bioID + ".zip";
    if (toRet.startsWith("/")) {
      zipDisk = URI.create("jar:file:" + toRet);
    } else {
      zipDisk = URI.create("jar:file:/" + toRet);
    }

    // Adding files to zip
    try (FileSystem zipfs = FileSystems.newFileSystem(zipDisk, zipProperties)) {
      // Create file inside zip
      Path zipFilePath = zipfs.getPath(bioID + ".xml");
      // Path where the file to be added resides
      Path addNewFile = Paths.get(filePath + "xml.xml");
      // Append file to ZIP File
      Files.copy(addNewFile, zipFilePath);

      if (!isInter) {
        // Now go for the xls file
        zipFilePath = zipfs.getPath(bioID + ".xls");
        addNewFile = Paths.get(filePath + "xls.xls");
        Files.copy(addNewFile, zipFilePath);
      }
    }

    // Delete temp files
    Files.deleteIfExists(Paths.get(filePath + "xml.xml"));
    Files.deleteIfExists(Paths.get(filePath + "xls.xls"));

    return toRet;
  }