Class IgnoreFile

java.lang.Object
io.github.jbastgen.stemma.app.git.IgnoreFile

public final class IgnoreFile extends Object
Adds lines to the ignore files of a repository (.gitignore, or .git/info/exclude for what is only for this clone) and builds the patterns for them: exactly this file, all files with this extension, all files with this name, or a folder. A line that is already there, or already covered by a pattern that is, is not written again.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The files a line can go to.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    anywhere(String fileName)
    The name anywhere in the repository (not anchored), for .DS_Store and Thumbs.db.
    static String
    exact(String relPath, boolean folder)
    Exactly this file or folder, from the root of the repository: /src/App.java, /build/ for a folder.
    static String
    extension(String fileName)
    *.log for build.log; null when the name has no extension (Makefile, .gitignore).
    static String
    The extension with its dot, for a menu text: .log; null when there is none.
    static List<String>
    folders(String relPath, int max)
    The folders above a file, nearest first, at most max: /a/b/, /a/ for a/b/c.txt.

    Methods inherited from class java.lang.Object

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

    • exact

      public static String exact(String relPath, boolean folder)
      Exactly this file or folder, from the root of the repository: /src/App.java, /build/ for a folder.
    • extension

      public static String extension(String fileName)
      *.log for build.log; null when the name has no extension (Makefile, .gitignore).
    • extensionText

      public static String extensionText(String fileName)
      The extension with its dot, for a menu text: .log; null when there is none.
    • anywhere

      public static String anywhere(String fileName)
      The name anywhere in the repository (not anchored), for .DS_Store and Thumbs.db.
    • folders

      public static List<String> folders(String relPath, int max)
      The folders above a file, nearest first, at most max: /a/b/, /a/ for a/b/c.txt.