// Path: src/main/java/org/terasology/launcher/util/LauncherDirectoryUtils.java
// public static boolean containsFiles(Path directory) {
//     if (directory == null || !Files.exists(directory) || !Files.isDirectory(directory)) {
//         return false;
//     }
// 
//     try (Stream<Path> stream = Files.list(directory)) {
//         return stream.anyMatch(file -> Files.isRegularFile(file) || Files.isDirectory(file) && containsFiles(file));
//     } catch (IOException e) {
//         return false;
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/util/LauncherDirectoryUtils.java
// public static boolean containsGameData(final Path gameInstallationPath) {
//     boolean containsGameData = false;
//     if (FileUtils.isReadableDir(gameInstallationPath)) {
//         try (Stream<Path> stream = Files.list(gameInstallationPath)) {
//             containsGameData = stream.anyMatch(child -> Files.isDirectory(child)
//                     && isGameDataDirectoryName(child.getFileName().toString()) && containsFiles(child));
//         } catch (IOException e) {
//             logger.error("Failed to check if folder contains game data", e);
//         }
//     }
//     return containsGameData;
// }


import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.terasology.launcher.util.LauncherDirectoryUtils.containsFiles;
import static org.terasology.launcher.util.LauncherDirectoryUtils.containsGameData;
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.launcher.util;




class TestLauncherDirectoryUtils {

    @TempDir
    Path tempFolder;

    @Test
    void testDirectoryWithFiles() throws IOException {
        Path file = tempFolder.resolve("File");
        assertNotNull(Files.createFile(file));
// Path: src/main/java/org/terasology/launcher/util/LauncherDirectoryUtils.java
// public static boolean containsFiles(Path directory) {
//     if (directory == null || !Files.exists(directory) || !Files.isDirectory(directory)) {
//         return false;
//     }
// 
//     try (Stream<Path> stream = Files.list(directory)) {
//         return stream.anyMatch(file -> Files.isRegularFile(file) || Files.isDirectory(file) && containsFiles(file));
//     } catch (IOException e) {
//         return false;
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/util/LauncherDirectoryUtils.java
// public static boolean containsGameData(final Path gameInstallationPath) {
//     boolean containsGameData = false;
//     if (FileUtils.isReadableDir(gameInstallationPath)) {
//         try (Stream<Path> stream = Files.list(gameInstallationPath)) {
//             containsGameData = stream.anyMatch(child -> Files.isDirectory(child)
//                     && isGameDataDirectoryName(child.getFileName().toString()) && containsFiles(child));
//         } catch (IOException e) {
//             logger.error("Failed to check if folder contains game data", e);
//         }
//     }
//     return containsGameData;
// }


// Path: src/test/java/org/terasology/launcher/util/TestLauncherDirectoryUtils.java
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.terasology.launcher.util.LauncherDirectoryUtils.containsFiles;
import static org.terasology.launcher.util.LauncherDirectoryUtils.containsGameData;

// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.launcher.util;




class TestLauncherDirectoryUtils {

    @TempDir
    Path tempFolder;

    @Test
    void testDirectoryWithFiles() throws IOException {
        Path file = tempFolder.resolve("File");
        assertNotNull(Files.createFile(file));
        assertTrue(containsFiles(tempFolder));