package com.tobedevoured.naether.util;

import java.util.Map;

public class Env {

    public static String getMavenHome() {

        Map<String, String> env = System.getenv();
        String mavenHome = env.get("MAVEN_HOME");
        if ( mavenHome == null ) {
            mavenHome = System.getProperty("maven.home");
            if (mavenHome == null) {
                // XXX: Default home for Ubuntu maven deb, probably not the best default
                mavenHome = "/usr/share/maven";
            }
        }

        return mavenHome;
    }

    public static String get(String name ){
        Map<String, String> env = System.getenv();
        return env.get(name);
    }
}

@@ -33,16 +33,37 @@
 .util;%0A%0A
+import java.io.File;%0A
 import j
@@ -76,16 +76,16 @@
 il.Map;%0A
-
 %0Apublic 
@@ -144,59 +144,8 @@
  %7B%0A%0A
-        Map%3CString, String%3E env = System.getenv();%0A
     
@@ -167,20 +167,16 @@
 nHome = 
-env.
 get(%22MAV
@@ -474,24 +474,24 @@
 %0A        %7D%0A%0A
-
         retu
@@ -507,24 +507,505 @@
 ome;%0A    %7D%0A%0A
+    public static String getLocalRepository() %7B%0A        String m2Repo = get(%22M2_REPO%22);%0A        if (m2Repo == null) %7B%0A            return new StringBuilder()%0A                .append(System.getProperty(%22user.home%22))%0A                .append(File.separator)%0A                .append(%22.m2%22)%0A                .append(File.separator)%0A                .append(%22repository%22)%0A                .toString();%0A        %7D else %7B%0A            return new File(m2Repo).getAbsolutePath();%0A        %7D%0A    %7D%0A%0A
     public s

add Env.getLocalRepository