Class Sanitizer
java.lang.Object
de.eldoria.schematicsanitizer.sanitizer.Sanitizer
The core class to sanitize a schematic.
Create a Sanitizer
instance via create(Path, Settings)
.
After that you can either get a report via check()
or directly fix()
the schematic by removing invalid blocks and entities.
-
Method Summary
Modifier and TypeMethodDescriptioncheck()
Executes the sanitization process and returns the resulting SanitizerReport.static Sanitizer
Creates a new Sanitizer instance with the given path and settings.fix()
Executes the fix process and returns the resulting SanitizerReport.Executes the fix process using the specified newName and returns the resulting SanitizerReport.Executes the fix process using the specified newPath and returns the resulting SanitizerReport.name()
Returns the name of the file without the file extension.
-
Method Details
-
create
Creates a new Sanitizer instance with the given path and settings.- Parameters:
path
- the path to the file to be sanitizedsettings
- the settings to be used for sanitizing the file- Returns:
- a new Sanitizer instance
- Throws:
IOException
- if an I/O error occurs while creating the Sanitizer instance
-
check
Executes the sanitization process and returns the resulting SanitizerReport.- Returns:
- the SanitizerReport containing the results of the sanitization process
- Throws:
IOException
- if an I/O error occurs during the sanitization process
-
fix
Executes the fix process and returns the resulting SanitizerReport.- Returns:
- the SanitizerReport containing the results of the fix process
- Throws:
IOException
- if an I/O error occurs during the fix process
-
fix
Executes the fix process using the specified newName and returns the resulting SanitizerReport.- Parameters:
newName
- the name of the fixed file- Returns:
- the SanitizerReport containing the results of the fix process
- Throws:
IOException
- if an I/O error occurs during the fix process
-
fix
Executes the fix process using the specified newPath and returns the resulting SanitizerReport.- Parameters:
newPath
- the new path of the fixed file- Returns:
- the SanitizerReport containing the results of the fix process
- Throws:
IOException
- if an I/O error occurs during the fix process
-
name
Returns the name of the file without the file extension.- Returns:
- the name of the file without the file extension.
-