Java Code Examples for com.ruoyi.framework.web.domain.server.SysFile#setTypeName()

The following examples show how to use com.ruoyi.framework.web.domain.server.SysFile#setTypeName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Server.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}
 
Example 2
Source File: Server.java    From RuoYi-Vue with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}
 
Example 3
Source File: Server.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 设置磁盘信息
 */
private void setSysFiles(OperatingSystem os)
{
    FileSystem fileSystem = os.getFileSystem();
    OSFileStore[] fsArray = fileSystem.getFileStores();
    for (OSFileStore fs : fsArray)
    {
        long free = fs.getUsableSpace();
        long total = fs.getTotalSpace();
        long used = total - free;
        SysFile sysFile = new SysFile();
        sysFile.setDirName(fs.getMount());
        sysFile.setSysTypeName(fs.getType());
        sysFile.setTypeName(fs.getName());
        sysFile.setTotal(convertFileSize(total));
        sysFile.setFree(convertFileSize(free));
        sysFile.setUsed(convertFileSize(used));
        sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
        sysFiles.add(sysFile);
    }
}