<commit_before>package it.andreacioni.sdrive;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import it.andreacioni.commons.swing.ProgressCallback;
import it.andreacioni.sdrive.archive.ArchiveService;
import it.andreacioni.sdrive.archive.CompressionLevel;
import it.andreacioni.sdrive.archive.Zip4jArchiveService;
import it.andreacioni.sdrive.cloud.CloudServive;
import it.andreacioni.sdrive.cloud.GoogleDriveCloudService;
import it.andreacioni.sdrive.utils.ResourceUtils;

public class SDrive {

	private final Logger LOG = LoggerFactory.getLogger(getClass());

	/** Directory to store user credentials for this application. */
	public static final File DATA_STORE_DIR = new File(System.getProperty("user.home"), ".sDrive");

	public static final String ZIP_NAME = "sDrive.zip";

	public static final File LOCAL_ARCHIVE = new File(DATA_STORE_DIR, ZIP_NAME);

	public static final File LOCAL_TEMP_DIR = new File(DATA_STORE_DIR, "tempdir");

	public static final String LOCAL_README_FILE_NAME = "README.txt";

	public static final String REMOTE_SDRIVE_DIR = "sDrive";

	public static final String REMOTE_SDRIVE_PATH = "/" + REMOTE_SDRIVE_DIR;

	public static final String REMOTE_README_PATH = REMOTE_SDRIVE_PATH + "/" + LOCAL_README_FILE_NAME;

	public static final String REMOTE_ARCHIVE_PATH = REMOTE_SDRIVE_PATH + "/" + ZIP_NAME;

	private CloudServive cloudService;

	private ArchiveService archiveService;

	private String masterPassword;

	private String accountName;

	public SDrive() {
		cloudService = new GoogleDriveCloudService();
		archiveService = new Zip4jArchiveService();

		archiveService.setCompressionLevel(CompressionLevel.HIGH);
	}

	public boolean init() {
		boolean ret = false;
		try {
			ret = cloudService.connect();
			accountName = cloudService.getAccountName();
		} catch (IOException e) {
			LOG.error("Exception connecting to cloud service");<commit_msg>compression level initialization moved into init()<commit_after>package it.andreacioni.sdrive;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import it.andreacioni.commons.swing.ProgressCallback;
import it.andreacioni.sdrive.archive.ArchiveService;
import it.andreacioni.sdrive.archive.CompressionLevel;
import it.andreacioni.sdrive.archive.Zip4jArchiveService;
import it.andreacioni.sdrive.cloud.CloudServive;
import it.andreacioni.sdrive.cloud.GoogleDriveCloudService;
import it.andreacioni.sdrive.utils.ResourceUtils;

public class SDrive {

	private final Logger LOG = LoggerFactory.getLogger(getClass());

	/** Directory to store user credentials for this application. */
	public static final File DATA_STORE_DIR = new File(System.getProperty("user.home"), ".sDrive");

	public static final String ZIP_NAME = "sDrive.zip";

	public static final File LOCAL_ARCHIVE = new File(DATA_STORE_DIR, ZIP_NAME);

	public static final File LOCAL_TEMP_DIR = new File(DATA_STORE_DIR, "tempdir");

	public static final String LOCAL_README_FILE_NAME = "README.txt";

	public static final String REMOTE_SDRIVE_DIR = "sDrive";

	public static final String REMOTE_SDRIVE_PATH = "/" + REMOTE_SDRIVE_DIR;

	public static final String REMOTE_README_PATH = REMOTE_SDRIVE_PATH + "/" + LOCAL_README_FILE_NAME;

	public static final String REMOTE_ARCHIVE_PATH = REMOTE_SDRIVE_PATH + "/" + ZIP_NAME;

	private CloudServive cloudService;

	private ArchiveService archiveService;

	private String masterPassword;

	private String accountName;

	public SDrive() {
		cloudService = new GoogleDriveCloudService();
		archiveService = new Zip4jArchiveService();
	}

	public boolean init() {
		boolean ret = false;
		try {
			ret = cloudService.connect();
			accountName = cloudService.getAccountName();
			archiveService.setCompressionLevel(CompressionLevel.HIGH);
		} catch (IOException e) {
			LOG.error("Exception connecting to cloud service");
{'fraction_non_alphanumeric': 0.09049557098395979, 'fraction_numerical': 0.0019152501795547043, 'mean_word_length': 5.760517799352751, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7590869', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1285, 'n_words': 304}