JNA API 3.5.1
com.sun.jna.platform.win32

Class Kernel32Util

    • Constructor Detail

      • Kernel32Util

        public Kernel32Util()
    • Method Detail

      • getComputerName

        public static String getComputerName()
        Get current computer NetBIOS name.
        Returns:
        Netbios name.
      • formatMessageFromHR

        public static String formatMessageFromHR(WinNT.HRESULT code)
        Format a message from an HRESULT.
        Parameters:
        code - HRESULT
        Returns:
        Formatted message.
      • formatMessageFromLastErrorCode

        public static String formatMessageFromLastErrorCode(int code)
        Format a system message from an error code.
        Parameters:
        code - Error code, typically a result of GetLastError.
        Returns:
        Formatted message.
      • getTempPath

        public static String getTempPath()
        Return the path designated for temporary files.
        Returns:
        Path.
      • deleteFile

        public static void deleteFile(String filename)
      • getLogicalDriveStrings

        public static String[] getLogicalDriveStrings()
        Returns valid drives in the system.
        Returns:
        An array of valid drives.
      • getFileAttributes

        public static int getFileAttributes(String fileName)
        Retrieves file system attributes for a specified file or directory.
        Parameters:
        fileName - The name of the file or directory.
        Returns:
        The attributes of the specified file or directory.
      • getDriveType

        public static int getDriveType(String rootName)
        Returns:
        One of the WinBase.DRIVE_* constants.
      • getEnvironmentVariable

        public static String getEnvironmentVariable(String name)
        Get the value of an environment variable.
        Parameters:
        name - Name of the environment variable.
        Returns:
        Value of an environment variable.
JNA API 3.5.1

Copyright © 2007-2012 Timothy Wall. All Rights Reserved.