diff --git a/.gitignore b/.gitignore
index 5b7b1e4..b9d3ea1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ target
.settings
.project
work
+/bin/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1eeae45
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# envfile-plugin
+Hudson envfile plugin
+
+This project is a fork to add a new feature.
+It supports remote files over HTTP(s) and local filesystem.
diff --git a/pom.xml b/pom.xml
index 3984937..a60aa75 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
org.hudsonci.plugins
envfile
- 1.3-h-2-SNAPSHOT
+ 1.3-h-2
hpi
Hudson Environment File Plugin
https://wiki.hudson-ci.org/display/HUDSON/Envfile+Plugin
@@ -41,6 +41,15 @@
+
+ Ricardo M. Augusto
+ rmaugusto@gmail.com
+
+
+ Developer
+
+
+
diff --git a/pom.xml.releaseBackup b/pom.xml.releaseBackup
new file mode 100644
index 0000000..d3c0159
--- /dev/null
+++ b/pom.xml.releaseBackup
@@ -0,0 +1,68 @@
+
+ 4.0.0
+
+ org.eclipse.hudson.plugins
+ hudson-plugin-parent
+ 3.0.0
+
+
+ org.hudsonci.plugins
+ envfile
+ 1.3-h-2-SNAPSHOT
+ hpi
+ Hudson Environment File Plugin
+ https://wiki.hudson-ci.org/display/HUDSON/Envfile+Plugin
+
+
+
+ buildwrapper
+
+
+
+
+ schristou88
+ Steven Christou
+ schristou88@gmail.com
+
+
+ Maintainer
+
+
+
+
+
+
+
+ Anders Johansson
+ ajoajoajo@gmail.com
+
+
+ Original Developer
+
+
+
+
+ Ricardo M. Augusto
+ rmaugusto@gmail.com
+
+
+ Developer
+
+
+
+
+
+
+
+ The MIT license
+ http://www.opensource.org/licenses/mit-license.php
+ repo
+
+
+
+
+ scm:git:git://github.com/hudson3-plugins/envfile-plugin.git
+ scm:git:git@github.com:hudson3-plugins/envfile-plugin.git
+ https://github.com/hudson3-plugins/envfile-plugin
+
+
diff --git a/release.properties b/release.properties
new file mode 100644
index 0000000..97c599b
--- /dev/null
+++ b/release.properties
@@ -0,0 +1,16 @@
+#release configuration
+#Wed May 25 16:59:04 BRT 2016
+project.scm.org.hudsonci.plugins\:envfile.tag=HEAD
+project.scm.org.hudsonci.plugins\:envfile.url=https\://github.com/hudson3-plugins/envfile-plugin
+project.scm.org.hudsonci.plugins\:envfile.connection=scm\:git\:git\://github.com/hudson3-plugins/envfile-plugin.git
+scm.tag=envfile-1.3-h-2
+scm.url=scm\:git\:git@github.com\:hudson3-plugins/envfile-plugin.git
+pushChanges=false
+preparationGoals=clean verify
+project.scm.org.hudsonci.plugins\:envfile.developerConnection=scm\:git\:git@github.com\:hudson3-plugins/envfile-plugin.git
+project.dev.org.hudsonci.plugins\:envfile=1.3-h-3-SNAPSHOT
+remoteTagging=true
+scm.commentPrefix=[maven-release-plugin]
+project.rel.org.hudsonci.plugins\:envfile=1.3-h-2
+exec.additionalArguments=-Psonatype-oss-release
+completedPhase=generate-release-poms
diff --git a/src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java b/src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java
index 323bd82..3fd6e4c 100755
--- a/src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java
+++ b/src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java
@@ -1,5 +1,6 @@
package hudson.plugins.envfile;
+import java.util.StringTokenizer;
import hudson.EnvVars;
import hudson.Extension;
import hudson.Launcher;
@@ -10,7 +11,7 @@
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrapperDescriptor;
-import java.io.FileInputStream;
+import java.io.InputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
@@ -82,7 +83,7 @@ private Properties readPropsFromFile(String path, Map currentMap
console(Messages.EnvFileBuildWrapper_Console_ReadingFile());
Properties props = new Properties();
- FileInputStream fis = null;
+ InputStream fis = null;
String resolvedPath = Util.replaceMacro(path, currentMap);
console(Messages.EnvFileBuildWrapper_Console_PathToFile() + ": " + resolvedPath);
@@ -90,7 +91,7 @@ private Properties readPropsFromFile(String path, Map currentMap
{
if(path != null)
{
- fis = new FileInputStream(resolvedPath);
+ fis = InputStreamFactory.createInputStream(resolvedPath);
props.load(fis);
}
else
@@ -119,9 +120,9 @@ private Properties readPropsFromFile(String path, Map currentMap
/**
* Helper to close environment file.
- * @param fis {@link FileInputStream} for environment file.
+ * @param fis {@link InputStream} for environment file.
*/
- private void close(FileInputStream fis)
+ private void close(InputStream fis)
{
try
{
@@ -143,33 +144,41 @@ private Map getEnvFileMap(Map currentMap)
Map newFileEnvMap = new HashMap();
tmpFileEnvMap.putAll(currentMap);
-
- //Fetch env variables from fil as properties
- Properties envProps = readPropsFromFile(filePath, currentMap);
-
- if(envProps != null || envProps.size() < 1)
- {
-
- //Add env variables to temporary env map and file map containing new variables.
- for (Entry