提交 8dfa6f73 编写于 作者: H Hans-Joachim Kliemeck

added ability to get remote disk sizes

上级 5e7b844b
......@@ -1409,6 +1409,45 @@ public final class FilePath implements Serializable {
});
}
/**
* Returns the number of unallocated bytes in the partition of that file.
*
*/
public long getFreeDiskSpace() throws IOException, InterruptedException {
return act(new FileCallable<Long>() {
private static final long serialVersionUID = 1L;
public Long invoke(File f, VirtualChannel channel) throws IOException {
return f.getFreeSpace();
}
});
}
/**
* Returns the total number of bytes in the partition of that file.
*
*/
public long getTotalDiskSpace() throws IOException, InterruptedException {
return act(new FileCallable<Long>() {
private static final long serialVersionUID = 1L;
public Long invoke(File f, VirtualChannel channel) throws IOException {
return f.getTotalSpace();
}
});
}
/**
* Returns the number of usable bytes in the partition of that file.
*
*/
public long getUsableDiskSpace() throws IOException, InterruptedException {
return act(new FileCallable<Long>() {
private static final long serialVersionUID = 1L;
public Long invoke(File f, VirtualChannel channel) throws IOException {
return f.getUsableSpace();
}
});
}
/**
* Sets the file permission.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册