<commit_before>/*
 * Copyright 2015 Adaptris Ltd.
 * 
 * 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.adaptris.filetransfer;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Abstract implementation of FileTransferClient.
 * 
 * @author lchan
 * @author $Author: lchan $
 */
public abstract class FileTransferClientImp implements FileTransferClient {

  protected transient Logger logR;
  private transient boolean additionalDebug = false;
  public FileTransferClientImp() {
    logR = LoggerFactory.getLogger(this.getClass().getName());
  }

  /**
   * Set up SOCKS v4/v5 proxy settings. This can be used if there is a SOCKS
   * proxy server in place that must be connected thru. Note that setting these
   * properties directs <b>all</b> TCP sockets in this JVM to the SOCKS proxy
   * 
   * @param port SOCKS proxy port
   * @param host SOCKS proxy hostname
   */
  public static void initSOCKS(String port, String host) {
    Properties props = System.getProperties();
    props.put("socksProxyPort", port);
    props.put("socksProxyHost", host);
    System.setProperties(props);
  }

  /**
   * Set up SOCKS username and password for SOCKS username/password
   * authentication. Often, no authentication will be required but the SOCKS
   * server may be configured to request these.
   * 
   * @param username the SOCKS username
   * @param password the SOCKS password
   */
  public static void initSOCKSAuthentication(String username, String password) {
    Properties props = System.getProperties();
    props.put("java.net.socks.username", username);
    props.put("java.net.socks.password", password);
    System.setProperties(props);
  }

  /**
   * @see com.adaptris.filetransfer.FileTransferClient#put(java.lang.String,
   *      java.lang.String)
   */
  public void put(String localPath, String remoteFile) throws IOException,
      FileTransferException {
    put(localPath, remoteFile, false);
  }

  /**
   * 
   * @see FileTransferClient#put(java.lang.String, java.lang.String, boolean)
   */
  public void put(String localPath, String remoteFile, boolean append)
      throws IOException, FileTransferException {
    FileInputStream in = null;
    try {
      in = new FileInputStream(localPath);
      put(in, remoteFile, append);
    }
    finally {
      if (in != null) in.close();<commit_msg>Removed some unused methods.<commit_after>/*
 * Copyright 2015 Adaptris Ltd.
 * 
 * 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.adaptris.filetransfer;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Abstract implementation of FileTransferClient.
 * 
 * @author lchan
 * @author $Author: lchan $
 */
public abstract class FileTransferClientImp implements FileTransferClient {

  protected transient Logger logR;
  private transient boolean additionalDebug = false;
  public FileTransferClientImp() {
    logR = LoggerFactory.getLogger(this.getClass().getName());
  }


  /**
   * @see com.adaptris.filetransfer.FileTransferClient#put(java.lang.String,
   *      java.lang.String)
   */
  public void put(String localPath, String remoteFile) throws IOException,
      FileTransferException {
    put(localPath, remoteFile, false);
  }

  /**
   * 
   * @see FileTransferClient#put(java.lang.String, java.lang.String, boolean)
   */
  public void put(String localPath, String remoteFile, boolean append)
      throws IOException, FileTransferException {
    FileInputStream in = null;
    try {
      in = new FileInputStream(localPath);
      put(in, remoteFile, append);
    }
    finally {
      if (in != null) in.close();
{'fraction_non_alphanumeric': 0.09338221107466718, 'fraction_numerical': 0.004244645957939417, 'mean_word_length': 3.769089236430543, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6722517', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1429, 'n_words': 480}