Object FileUtilities.Companion

    • Constructor Detail

    • Method Detail

      • replaceFile

         final Boolean replaceFile(File sourceFile, File destinationFile)

        Move a file from source to destination, and replace the destination file if it exists.

        Parameters:
        sourceFile - The source file.
        destinationFile - The destination file to be replaced by the source file.
        Returns:

        Returns true if the file was successfully replaced.

      • unzipArchive

         final Unit unzipArchive(String zipFile, String destinationDirectory)

        Unzips the downloaded modpack ZIP-archive to the specified directory.

        Parameters:
        zipFile - The path to the ZIP-archive which we want to unzip.
        destinationDirectory - The directory into which the ZIP-archive will be unzipped into.
      • isLink

         final Boolean isLink(String file)

        Check if the given file is a UNIX symlink or Windows lnk.

        Parameters:
        file - The file to check.
        Returns:

        true if the given file is a UNIX symlink or Windows lnk.

      • isLink

         final Boolean isLink(File file)

        Check if the given file is a UNIX symlink or Windows lnk.

        Parameters:
        file - The file to check.
        Returns:

        true if the given file is a UNIX symlink or Windows lnk.

      • resolveLink

         final String resolveLink(String link)

        Resolve a given link/symlink to its source.

        Parameters:
        link - The link you want to resolve.
        Returns:

        Path to the source of the link. If the specified file is not a link, the path to the passed file is returned.

      • resolveLink

         final String resolveLink(File link)

        Resolve a given link/symlink to its source.

        Parameters:
        link - The link you want to resolve.
        Returns:

        Path to the source of the link. If the specified file is not a link, the path to the passed file is returned.

      • isReadWritePermissionSet

         final Boolean isReadWritePermissionSet(Path fileOrDirectory)

        Check the given file or directory for read- and write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if both read- and write-permissions are set.

      • isReadWritePermissionSet

         final Boolean isReadWritePermissionSet(String fileOrDirectory)

        Check the given file or directory for read- and write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if both read- and write-permissions are set.

      • isReadWritePermissionSet

         final Boolean isReadWritePermissionSet(File fileOrDirectory)

        Check the given file or directory for read- and write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if both read- and write-permissions are set.

      • isReadPermissionSet

         final Boolean isReadPermissionSet(Path fileOrDirectory)

        Check the given file or directory for read-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if read-permissions are set.

      • isReadPermissionSet

         final Boolean isReadPermissionSet(String fileOrDirectory)

        Check the given file or directory for read-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if read-permissions are set.

      • isReadPermissionSet

         final Boolean isReadPermissionSet(File fileOrDirectory)

        Check the given file or directory for read-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if read-permissions are set.

      • isWritePermissionSet

         final Boolean isWritePermissionSet(Path fileOrDirectory)

        Check the given file or directory for write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if write-permissions are set.

      • isWritePermissionSet

         final Boolean isWritePermissionSet(String fileOrDirectory)

        Check the given file or directory for write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if write-permissions are set.

      • isWritePermissionSet

         final Boolean isWritePermissionSet(File fileOrDirectory)

        Check the given file or directory for write-permission.

        Parameters:
        fileOrDirectory - File or directory.
        Returns:

        true if write-permissions are set.

      • openFolder

         final Unit openFolder(String folder)

        Open the specified folder in the file explorer.

        Parameters:
        folder - The folder to open.
      • openFolder

         final Unit openFolder(File folder)

        Open the specified folder in the file explorer.

        Parameters:
        folder - The folder to open.
      • openFile

         final Unit openFile(String fileToOpen)

        Open the specified file in an editor.

        Parameters:
        fileToOpen - The file to open.
      • openFile

         final Unit openFile(File fileToOpen)

        Open the specified file in an editor.

        Parameters:
        fileToOpen - The file to open.