throw NfsUnreachableException from getMountedFileSystemUsage

This commit is contained in:
Doug MacEachern 2005-03-15 18:45:44 +00:00
parent 32282980ab
commit 08cb512ad1

View File

@ -532,12 +532,12 @@ public class Sigar implements SigarProxy {
* before attempting to get the file system stats to prevent application * before attempting to get the file system stats to prevent application
* hang when an NFS server is down. * hang when an NFS server is down.
* @param name Name of the directory on which filesystem is mounted. * @param name Name of the directory on which filesystem is mounted.
* @exception SigarException If given directory is not mounted * @exception SigarException If given directory is not mounted.
* or NFS server is unreachable. * @exception NfsUnreachableException If NFS server is unreachable.
* @see net.hyperic.sigar.Sigar#getFileSystemUsage * @see net.hyperic.sigar.Sigar#getFileSystemUsage
*/ */
public FileSystemUsage getMountedFileSystemUsage(String name) public FileSystemUsage getMountedFileSystemUsage(String name)
throws SigarException { throws SigarException, NfsUnreachableException {
FileSystem fs = getFileSystemMap().getMountPoint(name); FileSystem fs = getFileSystemMap().getMountPoint(name);
@ -548,8 +548,7 @@ public class Sigar implements SigarProxy {
if (fs instanceof NfsFileSystem) { if (fs instanceof NfsFileSystem) {
NfsFileSystem nfs = (NfsFileSystem)fs; NfsFileSystem nfs = (NfsFileSystem)fs;
if (!nfs.ping()) { if (!nfs.ping()) {
throw new SigarException(nfs.getHostname() + ":" + name + throw nfs.getUnreachableException();
" nfs server unreachable");
} }
} }