Skip to content

Package net.minecraft.world.level.validation

Part 1/1


ContentValidationException

  • Full name: net.minecraft.world.level.validation.ContentValidationException
  • Package: net.minecraft.world.level.validation
  • Source: commonnet/minecraft/world/level/validation/ContentValidationException.java
  • Type: class
  • Modifiers: public
  • Extends: Exception

net.minecraft.world.level.validation.ContentValidationException#ContentValidationException(Path,List<ForbiddenSymlinkInfo>)

  • Origin: common
  • Source: net/minecraft/world/level/validation/ContentValidationException.java:11
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ ContentValidationException ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: directory, entries.

Parameters

  • Path path
  • List<ForbiddenSymlinkInfo> list

ตัวอย่างใช้งาน

Path path = ...;
List<ForbiddenSymlinkInfo> list = ...;
ContentValidationException instance = new ContentValidationException(path, list);

net.minecraft.world.level.validation.ContentValidationException#getMessage()

  • Origin: common
  • Source: net/minecraft/world/level/validation/ContentValidationException.java:16
  • Modifiers: public
  • Return: String

คืออะไร

อ่านค่า Message

ทำงานยังไง

คืนค่า: getMessage(this.directory, this.entries).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ContentValidationException instance = ...;
String result = instance.getMessage();

net.minecraft.world.level.validation.ContentValidationException#getMessage(Path,List<ForbiddenSymlinkInfo>)

  • Origin: common
  • Source: net/minecraft/world/level/validation/ContentValidationException.java:21
  • Modifiers: public static
  • Return: String

คืออะไร

อ่านค่า Message

ทำงานยังไง

เรียกต่อ: stream(), map(), link(), target(), collect(), joining().

Parameters

  • Path path
  • List<ForbiddenSymlinkInfo> list

ตัวอย่างใช้งาน

Path path = ...;
List<ForbiddenSymlinkInfo> list = ...;
String result = ContentValidationException.getMessage(path, list);

DirectoryValidator

  • Full name: net.minecraft.world.level.validation.DirectoryValidator
  • Package: net.minecraft.world.level.validation
  • Source: commonnet/minecraft/world/level/validation/DirectoryValidator.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.validation.DirectoryValidator#DirectoryValidator(PathMatcher)

  • Origin: common
  • Source: net/minecraft/world/level/validation/DirectoryValidator.java:18
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ DirectoryValidator ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: symlinkTargetAllowList.

Parameters

  • PathMatcher pathMatcher

ตัวอย่างใช้งาน

PathMatcher pathMatcher = ...;
DirectoryValidator instance = new DirectoryValidator(pathMatcher);

net.minecraft.world.level.validation.DirectoryValidator#validateDirectory(Path,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/validation/DirectoryValidator.java:35
  • Modifiers: public
  • Return: List<ForbiddenSymlinkInfo>

คืออะไร

ตรวจสอบความถูกต้อง Directory

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. เรียกต่อ: readAttributes(), isRegularFile(), isSymbolicLink(), validateSymlink(), readSymbolicLink(), validateKnownDirectory(). สร้างออบเจ็กต์: ArrayList<>, IOException. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • Path path
  • boolean bl

Throws

  • IOException

ตัวอย่างใช้งาน

DirectoryValidator instance = ...;
Path path = ...;
List<ForbiddenSymlinkInfo> result = instance.validateDirectory(path, true);

net.minecraft.world.level.validation.DirectoryValidator#validateKnownDirectory(Path,List<ForbiddenSymlinkInfo>)

  • Origin: common
  • Source: net/minecraft/world/level/validation/DirectoryValidator.java:62
  • Modifiers: public
  • Return: void

คืออะไร

ตรวจสอบความถูกต้อง Known Directory

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: walkFileTree(), validateSymlink(), isSymbolicLink(), preVisitDirectory(), visitFile(). สร้างออบเจ็กต์: SimpleFileVisitor<Path>. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Path path
  • List<ForbiddenSymlinkInfo> list

Throws

  • IOException

ตัวอย่างใช้งาน

DirectoryValidator instance = ...;
Path path = ...;
List<ForbiddenSymlinkInfo> list = ...;
instance.validateKnownDirectory(path, list);

net.minecraft.world.level.validation.DirectoryValidator#validateSymlink(Path)

  • Origin: common
  • Source: net/minecraft/world/level/validation/DirectoryValidator.java:29
  • Modifiers: public
  • Return: List<ForbiddenSymlinkInfo>

คืออะไร

ตรวจสอบความถูกต้อง Symlink

ทำงานยังไง

สร้างออบเจ็กต์: ArrayList<>. คืนค่า: list.

Parameters

  • Path path

Throws

  • IOException

ตัวอย่างใช้งาน

DirectoryValidator instance = ...;
Path path = ...;
List<ForbiddenSymlinkInfo> result = instance.validateSymlink(path);

net.minecraft.world.level.validation.DirectoryValidator#validateSymlink(Path,List<ForbiddenSymlinkInfo>)

  • Origin: common
  • Source: net/minecraft/world/level/validation/DirectoryValidator.java:22
  • Modifiers: public
  • Return: void

คืออะไร

ตรวจสอบความถูกต้อง Symlink

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: readSymbolicLink(), matches(), add(). สร้างออบเจ็กต์: ForbiddenSymlinkInfo.

Parameters

  • Path path
  • List<ForbiddenSymlinkInfo> list

Throws

  • IOException

ตัวอย่างใช้งาน

DirectoryValidator instance = ...;
Path path = ...;
List<ForbiddenSymlinkInfo> list = ...;
instance.validateSymlink(path, list);

PathAllowList

  • Full name: net.minecraft.world.level.validation.PathAllowList
  • Package: net.minecraft.world.level.validation
  • Source: commonnet/minecraft/world/level/validation/PathAllowList.java
  • Type: class
  • Modifiers: public
  • Implements: PathMatcher

net.minecraft.world.level.validation.PathAllowList#getForFileSystem(FileSystem)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:24
  • Modifiers: public
  • Return: PathMatcher

คืออะไร

อ่านค่า For File System

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch ; มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: computeIfAbsent(), provider(), getScheme(), stream(), map(), compile(), toList(), error(). มีจุด return อย่างน้อย 5 จุด.

Parameters

  • FileSystem fileSystem

ตัวอย่างใช้งาน

PathAllowList instance = ...;
FileSystem fileSystem = ...;
PathMatcher result = instance.getForFileSystem(fileSystem);

net.minecraft.world.level.validation.PathAllowList#matches(Path)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:49
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ matches ตาม implementation ของ PathAllowList

ทำงานยังไง

เรียกต่อ: getForFileSystem(), getFileSystem(). คืนค่า: this.getForFileSystem(path.getFileSystem()).matches(path).

Parameters

  • Path path

ตัวอย่างใช้งาน

PathAllowList instance = ...;
Path path = ...;
boolean result = instance.matches(path);

net.minecraft.world.level.validation.PathAllowList#PathAllowList(List<PathAllowList.ConfigEntry>)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:20
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ PathAllowList ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: entries.

Parameters

  • List<PathAllowList.ConfigEntry> list

ตัวอย่างใช้งาน

List<PathAllowList.ConfigEntry> list = ...;
PathAllowList instance = new PathAllowList(list);

net.minecraft.world.level.validation.PathAllowList#readPlain(BufferedReader)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:54
  • Modifiers: public static
  • Return: PathAllowList

คืออะไร

อ่าน Plain

ทำงานยังไง

เรียกต่อ: lines(), flatMap(), parse(), stream(), toList(). สร้างออบเจ็กต์: PathAllowList. คืนค่า: new PathAllowList(bufferedReader.lines().flatMap(string -> PathAllowList.ConfigEntry.parse(string).stream()).toList()).

Parameters

  • BufferedReader bufferedReader

ตัวอย่างใช้งาน

BufferedReader bufferedReader = ...;
PathAllowList result = PathAllowList.readPlain(bufferedReader);

PathAllowList$ConfigEntry

  • Full name: net.minecraft.world.level.validation.PathAllowList$ConfigEntry
  • Package: net.minecraft.world.level.validation
  • Source: commonnet/minecraft/world/level/validation/PathAllowList.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.validation.PathAllowList$ConfigEntry#compile(FileSystem)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:59
  • Modifiers: public
  • Return: PathMatcher

คืออะไร

ดำเนินการ compile ตาม implementation ของ PathAllowList$ConfigEntry

ทำงานยังไง

เรียกต่อ: type(). คืนค่า: this.type().compile(fileSystem, this.pattern).

Parameters

  • FileSystem fileSystem

ตัวอย่างใช้งาน

PathAllowList.ConfigEntry instance = ...;
FileSystem fileSystem = ...;
PathMatcher result = instance.compile(fileSystem);

PathAllowList$EntryType

  • Full name: net.minecraft.world.level.validation.PathAllowList$EntryType
  • Package: net.minecraft.world.level.validation
  • Source: commonnet/minecraft/world/level/validation/PathAllowList.java
  • Type: interface
  • Modifiers: public

net.minecraft.world.level.validation.PathAllowList$EntryType#compile(FileSystem,String)

  • Origin: common
  • Source: net/minecraft/world/level/validation/PathAllowList.java:105
  • Modifiers: ``
  • Return: PathMatcher

คืออะไร

ดำเนินการ compile ตาม implementation ของ PathAllowList$EntryType

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • FileSystem fileSystem
  • String string

ตัวอย่างใช้งาน

PathAllowList.EntryType instance = ...;
FileSystem fileSystem = ...;
PathMatcher result = instance.compile(fileSystem, "value");