Class OpenedFiles

java.lang.Object
io.github.jbastgen.stemma.app.io.OpenedFiles

public final class OpenedFiles extends Object
Copies of files from old commits that were opened with the system's program (feature 12). They are written below opened in Stemma's configuration folder (never to a system temp folder, ADR 0007), read-only because they are a look at the past and not a place to work, and removed when Stemma ends and, after a crash, when it starts.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Removes all copies (the read-only flag is taken off first, where a system needs that to delete).
    static Path
    The folder for the copies.
    static Path
    write(Path root, String commitId, String path, byte[] content)
    Writes the file as it was in the commit to <root>/<first 12 of the commit id>/<path>: the real name and extension are kept, so the system finds the right program for it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • root

      public static Path root()
      The folder for the copies.
    • write

      public static Path write(Path root, String commitId, String path, byte[] content) throws IOException
      Writes the file as it was in the commit to <root>/<first 12 of the commit id>/<path>: the real name and extension are kept, so the system finds the right program for it.
      Throws:
      IOException
    • deleteAll

      public static void deleteAll(Path root)
      Removes all copies (the read-only flag is taken off first, where a system needs that to delete).