// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/auth/AuthenticationHelperFactory.java
// public class AuthenticationHelperFactory {
// 
// 	public static IAuthenticationHelper createAuthenticationHelper(String hdfsUri, String hdfsUser, String configPath)
// 			throws Exception {
// 		IAuthenticationHelper authHelper = null;
// 
// 		// if no URI is defined by the user, default to HDFS
// 		if (hdfsUri == null) {
// 			authHelper = new HDFSAuthenticationHelper(configPath);
// 		} else {
// 			String fsType = HDFSOperatorUtils.getFSType(hdfsUri);
// 			if (fsType.equals(IHdfsConstants.FS_WEBHDFS)) {
// 				authHelper = new WebHdfsAuthenticationHelper(configPath);
// 			} else {
// 				// HDFS and GPFS
// 				authHelper = new HDFSAuthenticationHelper(configPath);
// 			}
// 		}
// 
// 		return authHelper;
// 	}
// }


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
import com.ibm.streamsx.hdfs.client.auth.AuthenticationHelperFactory;
import com.ibm.streamsx.hdfs.client.auth.IAuthenticationHelper;
/*******************************************************************************
 * Copyright (C) 2014-2019, International Business Machines Corporation
 * All Rights Reserved
 *******************************************************************************/

package com.ibm.streamsx.hdfs.client;




abstract class AbstractHdfsClient implements IHdfsClient {

	public FileSystem fFileSystem;
	protected boolean fIsDisconnected;
	protected IAuthenticationHelper fAuthHelper;

	private HashMap<String, String> fConnectionProperties = new HashMap<String, String>();

	@Override
	public FileSystem connect(String fileSystemUri, String hdfsUser, String configPath) throws Exception {
// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/auth/AuthenticationHelperFactory.java
// public class AuthenticationHelperFactory {
// 
// 	public static IAuthenticationHelper createAuthenticationHelper(String hdfsUri, String hdfsUser, String configPath)
// 			throws Exception {
// 		IAuthenticationHelper authHelper = null;
// 
// 		// if no URI is defined by the user, default to HDFS
// 		if (hdfsUri == null) {
// 			authHelper = new HDFSAuthenticationHelper(configPath);
// 		} else {
// 			String fsType = HDFSOperatorUtils.getFSType(hdfsUri);
// 			if (fsType.equals(IHdfsConstants.FS_WEBHDFS)) {
// 				authHelper = new WebHdfsAuthenticationHelper(configPath);
// 			} else {
// 				// HDFS and GPFS
// 				authHelper = new HDFSAuthenticationHelper(configPath);
// 			}
// 		}
// 
// 		return authHelper;
// 	}
// }


// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/AbstractHdfsClient.java
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
import com.ibm.streamsx.hdfs.client.auth.AuthenticationHelperFactory;
import com.ibm.streamsx.hdfs.client.auth.IAuthenticationHelper;

/*******************************************************************************
 * Copyright (C) 2014-2019, International Business Machines Corporation
 * All Rights Reserved
 *******************************************************************************/

package com.ibm.streamsx.hdfs.client;




abstract class AbstractHdfsClient implements IHdfsClient {

	public FileSystem fFileSystem;
	protected boolean fIsDisconnected;
	protected IAuthenticationHelper fAuthHelper;

	private HashMap<String, String> fConnectionProperties = new HashMap<String, String>();

	@Override
	public FileSystem connect(String fileSystemUri, String hdfsUser, String configPath) throws Exception {
		fAuthHelper = AuthenticationHelperFactory.createAuthenticationHelper(fileSystemUri, hdfsUser, configPath);