FileSystemUtil .java

net.minecraft.util.FileSystemUtil (class, 33 lines): members: safeGetPath, LOGGER. imports: LogUtils.

net.minecraft.utilclass33 linescommon868 B

API Surface (1)

Path safeGetPath(final URI probeUri)

Fields & Constants (1)

LOGGER

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

FileSystemUtil.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util;
2
3
import com.mojang.logging.LogUtils;
4
import java.io.IOException;
5
import java.net.URI;
6
import java.nio.file.FileSystemAlreadyExistsException;
7
import java.nio.file.FileSystemNotFoundException;
8
import java.nio.file.FileSystems;
9
import java.nio.file.Path;
10
import java.nio.file.Paths;
11
import java.util.Collections;
12
import org.slf4j.Logger;
13
14
public class FileSystemUtil {
15
	private static final Logger LOGGER = LogUtils.getLogger();
16
17
	public static Path safeGetPath(final URI probeUri) throws IOException {
18
		try {
19
			return Paths.get(probeUri);
20
		} catch (FileSystemNotFoundException var3) {
21
		} catch (Throwable t) {
22
			LOGGER.warn("Unable to get path for: {}", probeUri, t);
23
		}
24
25
		try {
26
			FileSystems.newFileSystem(probeUri, Collections.emptyMap());
27
		} catch (FileSystemAlreadyExistsException var2) {
28
		}
29
30
		return Paths.get(probeUri);
31
	}
32
}
33

Decompiled Minecraft 26.3 source of FileSystemUtil (net/minecraft/util/FileSystemUtil.java) with Mojang official mappings, stored verbatim on the site.