From a449d2a7e10b07ee7cf004e08d68395438ed83c1 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 1 Mar 2009 05:39:10 +0000 Subject: [PATCH] Added DescriptorImpl git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15918 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/FileSystemProvisioner.java | 16 +++++++++++++--- .../java/hudson/os/solaris/ZFSProvisioner.java | 13 +++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/FileSystemProvisioner.java b/core/src/main/java/hudson/FileSystemProvisioner.java index 063485b1d4..d69a2ffa45 100644 --- a/core/src/main/java/hudson/FileSystemProvisioner.java +++ b/core/src/main/java/hudson/FileSystemProvisioner.java @@ -190,10 +190,7 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab * Default implementation that doesn't rely on any file system specific capability, * and thus can be used anywhere that Hudson runs. */ - @Extension public static final class Default extends FileSystemProvisioner { - public Default() {} - public void prepareWorkspace(AbstractBuild build, FilePath ws, TaskListener listener) throws IOException, InterruptedException { } @@ -220,5 +217,18 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab new FilePath(wss).unzip(dst); } } + + @Extension + public static final class DescriptorImpl extends FileSystemProvisionerDescriptor { + public boolean discard(FilePath ws, TaskListener listener) throws IOException, InterruptedException { + // the default provisioner doens't do anything special, + // so allow other types to manage it + return false; + } + + public String getDisplayName() { + return "Default"; + } + } } } diff --git a/core/src/main/java/hudson/os/solaris/ZFSProvisioner.java b/core/src/main/java/hudson/os/solaris/ZFSProvisioner.java index 9cf7202e9b..3c45a12011 100644 --- a/core/src/main/java/hudson/os/solaris/ZFSProvisioner.java +++ b/core/src/main/java/hudson/os/solaris/ZFSProvisioner.java @@ -27,6 +27,7 @@ import hudson.FileSystemProvisioner; import hudson.FilePath; import hudson.WorkspaceSnapshot; import hudson.FileSystemProvisionerDescriptor; +import hudson.Extension; import hudson.remoting.VirtualChannel; import hudson.FilePath.FileCallable; import hudson.model.AbstractBuild; @@ -98,5 +99,17 @@ public class ZFSProvisioner extends FileSystemProvisioner implements Serializabl throw new UnsupportedOperationException(); } + @Extension + public static final class DescriptorImpl extends FileSystemProvisionerDescriptor { + public boolean discard(FilePath ws, TaskListener listener) throws IOException, InterruptedException { + // TODO + return false; + } + + public String getDisplayName() { + return "ZFS"; + } + } + private static final long serialVersionUID = 1L; } -- GitLab