提交 7fae44d7 编写于 作者: J Jesse Glick

Making DiskSpaceMonitorDescriptor public since it is hard to write a disk space monitor without it.

上级 80328483
......@@ -9,6 +9,7 @@ import java.util.logging.Logger;
/**
* @author Kohsuke Kawaguchi
* @see DiskSpaceMonitorDescriptor
*/
public abstract class AbstractDiskSpaceMonitor extends NodeMonitor {
/**
......
......@@ -64,7 +64,7 @@ public class DiskSpaceMonitor extends AbstractDiskSpaceMonitor {
return Messages.DiskSpaceMonitor_DisplayName();
}
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
@Override protected DiskSpace monitor(Computer c) throws IOException, InterruptedException {
FilePath p = c.getNode().getRootPath();
if(p==null) return null;
......
......@@ -45,8 +45,9 @@ import org.kohsuke.stapler.export.Exported;
* {@link AbstractNodeMonitorDescriptor} for {@link NodeMonitor} that checks a free disk space of some directory.
*
* @author Kohsuke Kawaguchi
* @since 1.520
*/
/*package*/ abstract class DiskSpaceMonitorDescriptor extends AbstractNodeMonitorDescriptor<DiskSpace> {
public abstract class DiskSpaceMonitorDescriptor extends AbstractNodeMonitorDescriptor<DiskSpace> {
/**
* Value object that represents the disk space.
*/
......@@ -59,13 +60,6 @@ import org.kohsuke.stapler.export.Exported;
private boolean triggered;
private Class<? extends AbstractDiskSpaceMonitor> trigger;
/**
* @deprecated as of 1.467
*/
public DiskSpace(long size) {
this(".",size);
}
/**
* @param path
* Specify the file path that was monitored.
......@@ -165,15 +159,6 @@ import org.kohsuke.stapler.export.Exported;
private static final long serialVersionUID = 2L;
}
protected DiskSpace monitor(Computer c) throws IOException, InterruptedException {
return getFreeSpace(c);
}
/**
* Computes the free size.
*/
protected abstract DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException;
protected static final class GetUsableSpace implements FileCallable<DiskSpace> {
@IgnoreJRERequirement
public DiskSpace invoke(File f, VirtualChannel channel) throws IOException {
......
......@@ -66,7 +66,7 @@ public class TemporarySpaceMonitor extends AbstractDiskSpaceMonitor {
return Messages.TemporarySpaceMonitor_DisplayName();
}
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
@Override protected DiskSpace monitor(Computer c) throws IOException, InterruptedException {
FilePath p = c.getNode().getRootPath();
if(p==null) return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册