package xyz.capybara.clamav.configuration;

import java.io.File;
import java.nio.file.Path;

/**
 * This enum is used to determine the file separator char which will be used when building the path
 * to the file/directory to scan on the server filesystem. The possible values are:
 * <ul>
 *     <li>UNIX: the file separator will be <code>/</code></li>
 *     <li>WINDOWS: the file separator will be <code>\</code></li>
 *     <li>JVM_PLATFORM: the file separator will be the same as the one of the platform the JVM is running on</li>
 * </ul>
 */
public enum Platform {
    UNIX('/'),
    WINDOWS('\\'),
    JVM_PLATFORM(File.separatorChar);

    private char separator;

    Platform(char separator) {
        this.separator = separator;
    }

    public String toServerPath(Path path) {
        return path.toString().replace(File.separatorChar, separator);
    }
}

@@ -796,68 +796,263 @@
     
-return path.toString().replace(File.separatorChar, separator
+if (this == UNIX) %7B%0A            return path.toString().replace(WINDOWS.separator, UNIX.separator);%0A        %7D else if (this == WINDOWS) %7B%0A            return path.toString().replace(UNIX.separator, WINDOWS.separator);%0A        %7D%0A        return path.toString(
 );%0A 

Fix platform separator conversion