Make DependencyResolver in zeppelin-interpreter module not aware of ZEPPELIN_HOME

This commit is contained in:
Lee moon soo 2016-06-21 20:00:41 -07:00
parent 7b1b36accd
commit 6ee06b836a

View file

@ -63,11 +63,6 @@ public class DependencyResolver extends AbstractDependencyResolver {
return load(artifact, new LinkedList<String>());
}
public List<File> load(String artifact, String destPath)
throws RepositoryException, IOException {
return load(artifact, new LinkedList<String>(), destPath);
}
public synchronized List<File> load(String artifact, Collection<String> excludes)
throws RepositoryException, IOException {
if (StringUtils.isBlank(artifact)) {
@ -85,33 +80,6 @@ public class DependencyResolver extends AbstractDependencyResolver {
return libs;
}
}
public List<File> load(String artifact, Collection<String> excludes, String destPath)
throws RepositoryException, IOException {
List<File> libs = new LinkedList<File>();
if (StringUtils.isNotBlank(artifact)) {
libs = load(artifact, excludes);
// find home dir
String home = System.getenv("ZEPPELIN_HOME");
if (home == null) {
home = System.getProperty("zeppelin.home");
}
if (home == null) {
home = "..";
}
for (File srcFile : libs) {
File destFile = new File(home + "/" + destPath, srcFile.getName());
if (!destFile.exists() || !FileUtils.contentEquals(srcFile, destFile)) {
FileUtils.copyFile(srcFile, destFile);
logger.info("copy {} to {}", srcFile.getAbsolutePath(), destPath);
}
}
}
return libs;
}
public List<File> load(String artifact, File destPath) throws IOException, RepositoryException {
return load(artifact, new LinkedList<String>(), destPath);