Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2015-08-20 15:22:27 +0000
committerRoland Grunberg2015-08-20 16:08:13 +0000
commitd309de4c5f3d4295a52f6e1334a8067d54fa6805 (patch)
treefc22965b03405fdbee5d4636edf9636ac83c7d14 /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parent0ee2ce60357d32800967311046c71dd13c1adae9 (diff)
downloadorg.eclipse.linuxtools-d309de4c5f3d4295a52f6e1334a8067d54fa6805.tar.gz
org.eclipse.linuxtools-d309de4c5f3d4295a52f6e1334a8067d54fa6805.tar.xz
org.eclipse.linuxtools-d309de4c5f3d4295a52f6e1334a8067d54fa6805.zip
Bug 475501 - Auto-update connection detection script in data directory
Comparing the script 'lastModified' with the bundle's lastModified when the script exists. Change-Id: I80e4c51ec67744f3dfed392fe280fdcdcb962d12 Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/54241 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.core/src/org/eclipse')
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index e205a6b6a1..b550080f81 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -294,7 +294,10 @@ public class DockerConnection implements IDockerConnection {
final String scriptName) {
final File script = Activator.getDefault().getBundle()
.getDataFile(scriptName);
- if (script != null && !script.exists()) {
+ // if the script file does not exist or is outdated.
+ if (script != null
+ && (!script.exists() || script.lastModified() < Activator
+ .getDefault().getBundle().getLastModified())) {
try (final FileOutputStream output = new FileOutputStream(
script);
final InputStream is = DockerConnection.class

Back to the top