Class LibraryStore

java.lang.Object
io.github.jbastgen.stemma.app.config.LibraryStore

public final class LibraryStore extends Object
Remembers which repositories are in the library, as a list of folders in the per-user configuration directory. Reading never fails (a missing or broken file is an empty library); writing is atomic.
  • Constructor Details

    • LibraryStore

      public LibraryStore(Path file)
      Parameters:
      file - library.properties in the configuration folder
  • Method Details

    • defaultFile

      public static Path defaultFile()
      library.properties next to the settings file.
    • load

      public List<Path> load()
      The stored repository folders, in library order.
    • save

      public void save(List<Path> repositories) throws IOException
      Writes the library: a temporary file first, then moved over the old one, so a crash cannot leave a half-written library.
      Throws:
      IOException