<commit_before>package org.hive2hive.core.process.upload;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.util.List;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;

import org.apache.log4j.Logger;
import org.bouncycastle.crypto.DataLengthException;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.hive2hive.core.H2HConstants;
import org.hive2hive.core.IFileConfiguration;
import org.hive2hive.core.exceptions.PutFailedException;
import org.hive2hive.core.file.FileUtil;
import org.hive2hive.core.log.H2HLoggerFactory;
import org.hive2hive.core.model.Chunk;
import org.hive2hive.core.process.ProcessStep;
import org.hive2hive.core.process.common.put.BasePutProcessStep;
import org.hive2hive.core.security.EncryptionUtil;
import org.hive2hive.core.security.H2HEncryptionUtil;
import org.hive2hive.core.security.HybridEncryptedContent;

/**
 * First validates the file size according to the limits set in the {@link IFileConfiguration} object.
 * Then, puts a chunk and recursively calls itself until all chunks are stored in the DHT.
 * This class is intended to be subclassed because there are two scenarios:
 * <ul>
 * <li>A new file is uploaded</li>
 * <li>A new version of an existing is uploaded</li>
 * </ul>
 * The upload itself is not differing in these scenarios, but the subsequent steps might be.
 * 
 * @author Nico
 * 
 */
public class PutChunkStep extends BasePutProcessStep {

	private final static Logger logger = H2HLoggerFactory.getLogger(PutChunkStep.class);

	private final ProcessStep nextStep;
<commit_msg>Fixed documentation<commit_after>package org.hive2hive.core.process.upload;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.util.List;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;

import org.apache.log4j.Logger;
import org.bouncycastle.crypto.DataLengthException;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.hive2hive.core.H2HConstants;
import org.hive2hive.core.IFileConfiguration;
import org.hive2hive.core.exceptions.PutFailedException;
import org.hive2hive.core.file.FileUtil;
import org.hive2hive.core.log.H2HLoggerFactory;
import org.hive2hive.core.model.Chunk;
import org.hive2hive.core.process.ProcessStep;
import org.hive2hive.core.process.common.put.BasePutProcessStep;
import org.hive2hive.core.security.EncryptionUtil;
import org.hive2hive.core.security.H2HEncryptionUtil;
import org.hive2hive.core.security.HybridEncryptedContent;

/**
 * First validates the file size according to the limits set in the {@link IFileConfiguration} object.
 * Then, puts all chunks iteratively until all chunks are stored in the DHT.
 * This class is intended to be used for two scenarios:
 * <ul>
 * <li>A new file is uploaded</li>
 * <li>A new version of an existing is uploaded</li>
 * </ul>
 * The upload itself is not differing in these scenarios, but the subsequent steps might be.
 * 
 * @author Nico
 * 
 */
public class PutChunkStep extends BasePutProcessStep {

	private final static Logger logger = H2HLoggerFactory.getLogger(PutChunkStep.class);

	private final ProcessStep nextStep;

{'fraction_non_alphanumeric': 0.08731563421828908, 'fraction_numerical': 0.010029498525073746, 'mean_word_length': 5.662082514734774, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4046885', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1051, 'n_words': 268}