revert long windows filepath char

This commit is contained in:
James Seibel
2025-12-09 07:21:40 -06:00
parent b78b852ffb
commit 17c61a97cc
2 changed files with 2 additions and 21 deletions
@@ -64,16 +64,7 @@ public class ConfigFileHandler
public ConfigFileHandler(Path configPath)
{
String path = configPath.toAbsolutePath().toString(); // relative paths don't work if long file paths are enabled below
if (EPlatform.get() == EPlatform.WINDOWS)
{
// enable long file paths on windows to prevent edge cases where
// users' MC folder has a long file path (IE custom launchers)
// https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
path = "\\\\?\\" + path;
}
this.configPath = new File(path).toPath();
this.configPath = configPath;
this.nightConfig = CommentedFileConfig
.builder(this.configPath.toFile())
@@ -19,7 +19,6 @@
package com.seibel.distanthorizons.core.sql.repo;
import com.seibel.distanthorizons.core.jar.EPlatform;
import com.seibel.distanthorizons.core.logging.DhLogger;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.sql.DatabaseUpdater;
@@ -140,18 +139,9 @@ public abstract class AbstractDhRepo<TKey, TDTO extends IBaseDTO<TKey>> implemen
// connection setup //
//==================//
String filePath = this.databaseFile.getAbsolutePath(); // relative paths don't work if long file paths are enabled below
if (EPlatform.get() == EPlatform.WINDOWS)
{
// enable long file paths on windows to prevent edge cases where
// users' MC folder has a long file path (IE custom launchers)
// https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
filePath = "\\\\?\\" + filePath;
}
// get or create the connection,
// reusing existing connections reduces the chance of locking the database during trivial queries
this.connectionString = this.databaseType+":"+filePath;
this.connectionString = this.databaseType+":"+this.databaseFile.getPath();
this.connection = CONNECTIONS_BY_CONNECTION_STRING.computeIfAbsent(this.connectionString, (connectionString) ->