FileSystemCapabilities .java

net.minecraft.util.filefix.FileSystemCapabilities (record, 19 lines): record with 2 components. members: atomicMove, hardLinks, getMoveOptions.

net.minecraft.util.filefixrecord19 linescommon515 B

API Surface (2)

record FileSystemCapabilities(boolean atomicMove, boolean hardLinks)
CopyOption[] getMoveOptions()

Full Source

FileSystemCapabilities.java19 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.filefix;
2
3
import java.nio.file.CopyOption;
4
import java.nio.file.LinkOption;
5
import java.nio.file.StandardCopyOption;
6
7
public record FileSystemCapabilities(boolean atomicMove, boolean hardLinks) {
8
	public CopyOption[] getMoveOptions() {
9
		CopyOption[] moveOptions;
10
		if (this.atomicMove) {
11
			moveOptions = new CopyOption[]{StandardCopyOption.ATOMIC_MOVE, LinkOption.NOFOLLOW_LINKS};
12
		} else {
13
			moveOptions = new CopyOption[]{LinkOption.NOFOLLOW_LINKS};
14
		}
15
16
		return moveOptions;
17
	}
18
}
19

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