<commit_before>
/*
 * Copyright (C) 2013 Snowdream Mobile <<EMAIL>>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.snowdream.android.app.downloader;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;

import com.github.snowdream.android.app.downloader.dao.ISql;
import com.github.snowdream.android.app.downloader.dao.ISqlImpl;
import com.github.snowdream.android.util.Log;
import com.github.snowdream.android.util.concurrent.AsyncTask;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.sql.SQLException;

public class AsycDownloadTask extends AsyncTask<DownloadTask, Integer, DownloadTask> {

    private static final int MESSAGE_POST_ERROR = 0x1;

    private static final int MESSAGE_POST_ADD = 0x2;
    /**
     * http default
     */
    private static final int MODE_DEFAULT = 0x1;
    /**
     * http trunked
     */
    private static final int MODE_TRUNKED = 0x2;
    private static final String STORE_PATH = "/mnt/sdcard/snowdream/android/downloader/";
    private static final InternalHandler sHandler = new InternalHandler();
    /**
     * just get head detail message
     */
    private boolean isOnlyGetHead = false;
    private int mode = MODE_DEFAULT;

    public AsycDownloadTask(DownloadListener<Integer, DownloadTask> listener, boolean isOnlyGetHead) {
        super(listener);
        this.isOnlyGetHead = isOnlyGetHead;
    }

    /**
     * throw error
     *
     * @param task task
     * @param code The code of the exception
     */
    private void OnError(DownloadTask task, Integer code) {
        if (listener != null) {
            listener.onError(new DownloadException(code));
        }
    }<commit_msg>Updated the download directory<commit_after>
/*
 * Copyright (C) 2013 Snowdream Mobile <<EMAIL>>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.snowdream.android.app.downloader;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;

import com.github.snowdream.android.app.downloader.dao.ISql;
import com.github.snowdream.android.app.downloader.dao.ISqlImpl;
import com.github.snowdream.android.util.Log;
import com.github.snowdream.android.util.concurrent.AsyncTask;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.sql.SQLException;

public class AsycDownloadTask extends AsyncTask<DownloadTask, Integer, DownloadTask> {

    private static final int MESSAGE_POST_ERROR = 0x1;

    private static final int MESSAGE_POST_ADD = 0x2;
    /**
     * http default
     */
    private static final int MODE_DEFAULT = 0x1;
    /**
     * http trunked
     */
    private static final int MODE_TRUNKED = 0x2;
    private static final String STORE_PATH = Environment.DIRECTORY_DOWNLOADS;
    private static final InternalHandler sHandler = new InternalHandler();
    /**
     * just get head detail message
     */
    private boolean isOnlyGetHead = false;
    private int mode = MODE_DEFAULT;

    public AsycDownloadTask(DownloadListener<Integer, DownloadTask> listener, boolean isOnlyGetHead) {
        super(listener);
        this.isOnlyGetHead = isOnlyGetHead;
    }

    /**
     * throw error
     *
     * @param task task
     * @param code The code of the exception
     */
    private void OnError(DownloadTask task, Integer code) {
        if (listener != null) {
            listener.onError(new DownloadException(code));
        }
    }
{'fraction_non_alphanumeric': 0.0863202545068929, 'fraction_numerical': 0.006786850477200424, 'mean_word_length': 3.4701421800947867, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2147692', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1314, 'n_words': 419}