java.lang.Object
org.polyfrost.oneconfig.api.config.v1.backend.Backend
org.polyfrost.oneconfig.api.config.v1.backend.impl.FileBackend

public class FileBackend extends org.polyfrost.oneconfig.api.config.v1.backend.Backend
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.polyfrost.oneconfig.api.config.v1.backend.Backend

    org.polyfrost.oneconfig.api.config.v1.backend.Backend.RegistrationResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Path
     

    Fields inherited from class org.polyfrost.oneconfig.api.config.v1.backend.Backend

    LOGGER, UI_ONLY_METADATA
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileBackend(Path folder, FileSerializer<String>... serializers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    void
     
    protected boolean
    corrupt0(org.polyfrost.oneconfig.api.config.v1.Tree t)
     
    protected boolean
    delete0(@NotNull org.polyfrost.oneconfig.api.config.v1.Tree tree)
     
    void
    dodge(String fileName)
     
    Collection<org.polyfrost.oneconfig.api.config.v1.Tree>
    Gather all files in this directory and make trees of them where possible.
    Collection<org.polyfrost.oneconfig.api.config.v1.Tree>
    gatherAll(@Nullable String sub)
    Inspect all files in this directory (and optionally the given directory) and make trees of them where possible.
     
    @UnmodifiableView Collection<FileSerializer<String>>
     
    boolean
     
    protected org.polyfrost.oneconfig.api.config.v1.Tree
    load0(@NotNull String id)
     
    org.polyfrost.oneconfig.api.config.v1.Tree
    load0(Path p, String id)
     
    protected static Path
     
    protected static String
     
    boolean
    save0(@NotNull org.polyfrost.oneconfig.api.config.v1.Tree tree)
     
    protected static void
    write(Path p, String s)
     

    Methods inherited from class org.polyfrost.oneconfig.api.config.v1.backend.Backend

    corrupt, delete, exists, get, getTrees, load, load, putSafe, register, requestUpdate, save, save, saveAll, saveAll

    Methods inherited from class java.lang.Object

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

    • folder

      public final Path folder
  • Constructor Details

  • Method Details

    • mkdirs

      protected static Path mkdirs(Path p)
    • read

      protected static String read(Path p)
    • write

      protected static void write(Path p, String s)
    • addWatcher

      public FileBackend addWatcher() throws IOException
      Throws:
      IOException
    • hasWatcher

      public boolean hasWatcher()
    • closeWatcher

      public void closeWatcher()
    • dodge

      public void dodge(String fileName)
    • load0

      public org.polyfrost.oneconfig.api.config.v1.Tree load0(Path p, String id) throws Exception
      Throws:
      Exception
    • load0

      protected org.polyfrost.oneconfig.api.config.v1.Tree load0(@NotNull @NotNull String id) throws Exception
      Specified by:
      load0 in class org.polyfrost.oneconfig.api.config.v1.backend.Backend
      Throws:
      Exception
    • save0

      public boolean save0(@NotNull @NotNull org.polyfrost.oneconfig.api.config.v1.Tree tree)
      Specified by:
      save0 in class org.polyfrost.oneconfig.api.config.v1.backend.Backend
    • delete0

      protected boolean delete0(@NotNull @NotNull org.polyfrost.oneconfig.api.config.v1.Tree tree) throws Exception
      Specified by:
      delete0 in class org.polyfrost.oneconfig.api.config.v1.backend.Backend
      Throws:
      Exception
    • gatherAll

      public Collection<org.polyfrost.oneconfig.api.config.v1.Tree> gatherAll()
      Gather all files in this directory and make trees of them where possible.
    • gatherAll

      public Collection<org.polyfrost.oneconfig.api.config.v1.Tree> gatherAll(@Nullable @Nullable String sub)
      Inspect all files in this directory (and optionally the given directory) and make trees of them where possible.
    • getSerializers

      public @UnmodifiableView Collection<FileSerializer<String>> getSerializers()
    • addSerializer

      public void addSerializer(FileSerializer<String> serializer)
    • corrupt0

      protected boolean corrupt0(org.polyfrost.oneconfig.api.config.v1.Tree t)
      Specified by:
      corrupt0 in class org.polyfrost.oneconfig.api.config.v1.backend.Backend
    • getSerializer

      protected FileSerializer<String> getSerializer(Path p)