Interface FileWriter


public interface FileWriter
Writes config files to disk, keeping the comments and key order of the shipped defaults.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Stamped onto files the plugin writes itself, so a file the user never touched can be told apart from an edited one.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    save(Path pathToFile, Object fileResource, boolean checkLastModifiedTime)
    Writes a single file.
    void
    save(FilePack files, boolean checkExist, boolean checkLastModifiedTime)
    Writes a whole set of files.
  • Field Details

    • LAST_MODIFIED_TIME

      static final long LAST_MODIFIED_TIME
      Stamped onto files the plugin writes itself, so a file the user never touched can be told apart from an edited one.
  • Method Details

    • save

      void save(FilePack files, boolean checkExist, boolean checkLastModifiedTime)
      Writes a whole set of files.
      Parameters:
      files - the files to write
      checkExist - whether to skip files that already exist
      checkLastModifiedTime - whether to stamp the files so they are recognized as untouched later
    • save

      void save(Path pathToFile, Object fileResource, boolean checkLastModifiedTime)
      Writes a single file.
      Parameters:
      pathToFile - where to write
      fileResource - the object to serialize
      checkLastModifiedTime - whether to stamp the file so it is recognized as untouched later