CopyOnWriteFileStore .java

net.minecraft.util.filefix.virtualfilesystem.CopyOnWriteFileStore (class, 70 lines): members: getFileStoreAttributeView, supportsFileAttributeView, fs.

net.minecraft.util.filefix.virtualfilesystemclass70 linescommonextends FileStore1.7 KB

API Surface (9)

String name()
String type()
boolean isReadOnly()
long getTotalSpace()
long getUsableSpace()
long getUnallocatedSpace()
boolean supportsFileAttributeView(final Class<? extends FileAttributeView> type)
boolean supportsFileAttributeView(final String name)
Object getAttribute(final String attribute)

Fields & Constants (2)

name
fs

String literals (2)

"copy-on-write"
"basic"

Code Graph: Dependencies (1)

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

Full Source

CopyOnWriteFileStore.java70 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.filefix.virtualfilesystem;
2
3
import java.io.IOException;
4
import java.nio.file.FileStore;
5
import java.nio.file.Files;
6
import java.nio.file.attribute.BasicFileAttributeView;
7
import java.nio.file.attribute.FileAttributeView;
8
import java.nio.file.attribute.FileStoreAttributeView;
9
import org.jspecify.annotations.Nullable;
10
11
public class CopyOnWriteFileStore extends FileStore {
12
	private final String name;
13
	private final CopyOnWriteFileSystem fs;
14
15
	public CopyOnWriteFileStore(final String name, final CopyOnWriteFileSystem fs) {
16
		this.name = name;
17
		this.fs = fs;
18
	}
19
20
	@Override
21
	public String name() {
22
		return this.name;
23
	}
24
25
	@Override
26
	public String type() {
27
		return "copy-on-write";
28
	}
29
30
	@Override
31
	public boolean isReadOnly() {
32
		return false;
33
	}
34
35
	@Override
36
	public long getTotalSpace() throws IOException {
37
		return Files.getFileStore(this.fs.tmpDirectory()).getTotalSpace();
38
	}
39
40
	@Override
41
	public long getUsableSpace() throws IOException {
42
		return Files.getFileStore(this.fs.tmpDirectory()).getUsableSpace();
43
	}
44
45
	@Override
46
	public long getUnallocatedSpace() throws IOException {
47
		return Files.getFileStore(this.fs.tmpDirectory()).getUnallocatedSpace();
48
	}
49
50
	@Override
51
	public boolean supportsFileAttributeView(final Class<? extends FileAttributeView> type) {
52
		return type == BasicFileAttributeView.class;
53
	}
54
55
	@Override
56
	public boolean supportsFileAttributeView(final String name) {
57
		return "basic".equals(name);
58
	}
59
60
	@Override
61
	public <V extends FileStoreAttributeView> @Nullable V getFileStoreAttributeView(final Class<V> type) {
62
		throw new UnsupportedOperationException();
63
	}
64
65
	@Override
66
	public Object getAttribute(final String attribute) throws IOException {
67
		throw new UnsupportedOperationException();
68
	}
69
}
70

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