private List<FileSystemInfo> getFileSystems(boolean deferredUsageInfo) { List<String> mountPoints = new ArrayList<String>(); try { FileSystemMap map = sigar.getFileSystemMap(); mountPoints.addAll(map.keySet()); } catch (Exception e) { log.warn("Cannot obtain native file system information", e); // ignore native error otherwise } List<FileSystemInfo> infos = new ArrayList<FileSystemInfo>(); for (String mountPoint : mountPoints) { infos.add(new FileSystemInfo(mountPoint, deferredUsageInfo)); } return infos; }
public List<FileSystemInfo> getFileSystems() { List<String> mountPoints = new ArrayList<String>(); try { FileSystemMap map = sigar.getFileSystemMap(); mountPoints.addAll(map.keySet()); } catch (Exception e) { log.warn("Cannot obtain native file system information", e); // ignore native error otherwise } List<FileSystemInfo> infos = new ArrayList<FileSystemInfo>(); for (String mountPoint : mountPoints) { infos.add(new FileSystemInfo(mountPoint)); } return infos; }
public FileSystemInfo getFileSystem(String path) { String mountPoint = null; try { FileSystem mountPointForPath = sigar.getFileSystemMap().getMountPoint(path); if (mountPointForPath != null) mountPoint = mountPointForPath.getDirName(); } catch (Throwable e) { log.warn("Cannot obtain native file system information for [" + path + "]", e); // ignore native error otherwise } FileSystemInfo fileSystem = new FileSystemInfo(mountPoint); return fileSystem; }
public FileSystemInfo getFileSystem(String path) { String mountPoint = null; try { FileSystem mountPointForPath = sigar.getFileSystemMap().getMountPoint(path); if (mountPointForPath != null) mountPoint = mountPointForPath.getDirName(); } catch (Throwable e) { log.warn("Cannot obtain native file system information for [" + path + "]", e); // ignore native error otherwise } FileSystemInfo fileSystem = new FileSystemInfo(mountPoint); return fileSystem; }