Class ServerPackFile
-
- All Implemented Interfaces:
public final class ServerPackFileA ServerPackFile represents a source-destination-combination of two files/directories. The source is the file/directory, usually in the modpack, whilst the destination is the file to which the source is supposed to be copied to in the server pack.
Griefed
-
-
Field Summary
Fields Modifier and Type Field Description private final FilesourceFileprivate final PathsourcePathprivate final FiledestinationFileprivate final PathdestinationPath
-
Constructor Summary
Constructors Constructor Description ServerPackFile(File sourceFile, File destinationFile)Construct a new ServerPackFile from two File-objects, a source and a destination. ServerPackFile(Path sourcePath, Path destinationPath)Construct a new ServerPackFile from two Path-objects, a source and a destination.
-
Method Summary
Modifier and Type Method Description final FilegetSourceFile()The file being copied, in the modpack. final PathgetSourcePath()sourceFile as a Path, kept alongside it because the copy helpers want each form. final FilegetDestinationFile()Where it lands in the server pack. final PathgetDestinationPath()destinationFile as a Path. final Filecopy(Boolean overwrite)Copy this ServerPackFiles source to the destination. -
-
Method Detail
-
getSourceFile
final File getSourceFile()
The file being copied, in the modpack.
-
getSourcePath
final Path getSourcePath()
sourceFile as a Path, kept alongside it because the copy helpers want each form.
-
getDestinationFile
final File getDestinationFile()
Where it lands in the server pack.
-
getDestinationPath
final Path getDestinationPath()
destinationFile as a Path.
-
copy
final File copy(Boolean overwrite)
Copy this ServerPackFiles source to the destination. Already existing files are replaced. When the source-file is a directory, then the destination-directory is created as an empty directory. Any contents in the source-directory are NOT copied over to the destination-directory. See copyRecursively for an example on how to copy entire directories.
This method specifically does NOT copy recursively, because we would potentially copy previously EXCLUDED files, too. We do not want that. At all.
-
-
-
-