package com.var.web.util;

import java.io.File;

public class VarOneEnv {

	public static String VARONE_HOME_NAME = ".varone";
	public static String CONFIG = "conf";
	
	
	public File getVarOneHomePath(){
		File homePath = new File(new File(System.getProperty("user.home")), VARONE_HOME_NAME);
		this.mkdir(homePath);
		return homePath;
	}
	
	public File getVarOneConfPath(){
		File confPath = new File(this.getVarOneHomePath(), CONFIG);
		return confPath;
	}
	
	public File createVarOneConfPath(){
		File confPath = getVarOneConfPath();
		this.mkdir(confPath);
		return confPath;
	}
	
	public boolean checkHadoopConfXMLFile(File confPath){
		File hdfsSite = new File(confPath, "hdfs-site.xml");
		File yarnSite = new File(confPath, "yarn-site.xml");
		
		if(hdfsSite.exists() && yarnSite.exists()){
			return true;
		}else{
			return false;
		}
	}
	
	private void mkdir(File folderPath){
		if(!folderPath.exists()){
			folderPath.mkdir();
		}
	}
	
	
}

@@ -203,41 +203,37 @@
 %7B%0A%09%09
-File homePath = new File(new File
+return this.getVarOneHomePath
 (Sys
@@ -260,17 +260,16 @@
 r.home%22)
-)
 , VARONE
@@ -281,16 +281,143 @@
 _NAME);%0A
+%09%7D%0A%09%0A%09public File getVarOneHomePath(String homeDir, String homeName)%7B%0A%09%09File homePath = new File(new File(homeDir), homeName);%0A
 %09%09this.m
@@ -865,16 +865,71 @@
 .xml%22);%0A
+%09%09File coreSite = new File(confPath, %22core-site.xml%22);%0A
 %09%09%0A%09%09if(
@@ -962,24 +962,45 @@
 ite.exists()
+ && coreSite.exists()
 )%7B%0A%09%09%09return

Modify VarOneEnv class