Class ServerPackFile

  • All Implemented Interfaces:

    
    public final class ServerPackFile
    
                        

    A 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.

    Author:

    Griefed

    • Constructor Detail

      • ServerPackFile

        ServerPackFile(File sourceFile, File destinationFile)

        Construct a new ServerPackFile from two File-objects, a source and a destination.

        Parameters:
        sourceFile - The source file/directory.
        destinationFile - The destination file/directory in the server pack.
      • ServerPackFile

        ServerPackFile(Path sourcePath, Path destinationPath)

        Construct a new ServerPackFile from two Path-objects, a source and a destination.

        Parameters:
        sourcePath - The source file/directory.
        destinationPath - The destination file/directory in the server pack.
    • Method Detail

      • 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.