提交 50029495 编写于 作者: O Oliver Gondža

Merge pull request #982 from h0nIg/master

added ability to get remote disk sizes
......@@ -1406,6 +1406,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.
先完成此消息的编辑!
想要评论请 注册