use of com.axway.ats.agent.core.monitoring.systemmonitor.systeminformation.IFileSystem in project ats-framework by Axway.
the class OshiSystemInformation method listFileSystems.
@Override
public IFileSystem[] listFileSystems() {
FileSystem fs = this.systemInfo.getOperatingSystem().getFileSystem();
// enumerate only local drives. (Network ones are excluded)
List<OSFileStore> fileStores = fs.getFileStores(true);
List<IFileSystem> fileSystems = new ArrayList<IFileSystem>();
for (OSFileStore fileStore : fileStores) {
fileSystems.add(new OshiFileSystem(fileStore, fileStore.getMount()));
}
return fileSystems.toArray(new IFileSystem[fileSystems.size()]);
}
use of com.axway.ats.agent.core.monitoring.systemmonitor.systeminformation.IFileSystem in project ats-framework by Axway.
the class OshiSystemInformation method getFileSystem.
@Override
public IFileSystem getFileSystem(String devName) {
try {
FileSystem fs = this.os.getFileSystem();
List<OSFileStore> fileStores = fs.getFileStores();
for (OSFileStore fileStore : fileStores) {
if (fileStore.getName().equals(devName)) {
return new OshiFileSystem(fileStore, fileStore.getName());
}
}
throw new SystemInformationException("No such file system drive device '" + devName + "'");
} catch (Exception e) {
throw new SystemInformationException("Could not obtain file system for/from device '" + devName + "'", e);
}
}
Aggregations