Class Folder

java.lang.Object
fr.formiko.usuel.Folder

public class Folder extends Object
Class that have all link to all folder of formiko.
You can acces to file by using getters. Ex : getFolderStable()+getFolderImages() will return the path to stable images.
Author:
Hydrolien
  • Field Details

    • DEFAULT_NULL_VERSION

      private static String DEFAULT_NULL_VERSION
    • folderMain

      private String folderMain
    • folderStable

      private String folderStable
    • folderTemporary

      private String folderTemporary
    • folderResourcesPacks

      private String folderResourcesPacks
    • folderSaves

      private String folderSaves
    • folderBin

      private String folderBin
    • folderImages

      private String folderImages
    • folderSounds

      private String folderSounds
    • folderMusiques

      private String folderMusiques
    • folderMaps

      private String folderMaps
    • folderLanguages

      private String folderLanguages
    • folderLevels

      private String folderLevels
    • folderVideos

      private String folderVideos
    • missingFolder

      private int missingFolder
    • secondTime

      private boolean secondTime
    • launchDownload

      private boolean launchDownload
    • newVersionAviableTestDone

      private static boolean newVersionAviableTestDone
  • Constructor Details

    • Folder

      public Folder()
  • Method Details

    • getFolderMain

      public String getFolderMain()
    • setFolderMain

      public void setFolderMain(String folderMain)
    • setFolderMain

      public void setFolderMain()
    • getFolderStable

      public String getFolderStable()
    • setFolderStable

      public void setFolderStable(String folderStable)
    • getFolderTemporary

      public String getFolderTemporary()
    • setFolderTemporary

      public void setFolderTemporary(String folderTemporary)
    • getFolderResourcesPacks

      public String getFolderResourcesPacks()
    • setFolderResourcesPacks

      public void setFolderResourcesPacks(String folderResourcesPacks)
    • getFolderSaves

      public String getFolderSaves()
    • setFolderSaves

      public void setFolderSaves(String folderSaves)
    • getFolderBin

      public String getFolderBin()
    • setFolderBin

      public void setFolderBin(String folderBin)
    • getFolderImages

      public String getFolderImages()
    • setFolderImages

      public void setFolderImages(String folderImages)
    • getFolderSounds

      public String getFolderSounds()
    • setFolderSounds

      public void setFolderSounds(String folderSounds)
    • getFolderMusiques

      public String getFolderMusiques()
    • setFolderMusiques

      public void setFolderMusiques(String folderMusiques)
    • getFolderMaps

      public String getFolderMaps()
    • setFolderMaps

      public void setFolderMaps(String folderMaps)
    • getFolderLanguages

      public String getFolderLanguages()
    • setFolderLanguages

      public void setFolderLanguages(String folderLanguages)
    • getFolderLevels

      public String getFolderLevels()
    • setFolderLevels

      public void setFolderLevels(String folderLevels)
    • getFolderVideos

      public String getFolderVideos()
    • setFolderVideos

      public void setFolderVideos(String folderVideos)
    • setLaunchDownload

      public void setLaunchDownload(boolean b)
    • iniFolderMain

      public void iniFolderMain(Os os)
      Initialize the main folder name depending of OS.
      Parameters:
      os - Os to use for name initialisation.
    • iniFolderMain

      public void iniFolderMain()
    • ini

      public int ini(boolean allowedDownolad)
      Initialize missing folder if some folder are missing.
      It will call download if main folder is missing.
      It will send an info if some were missing and an error if some unfixable folder were missing.
      Parameters:
      allowedDownolad - true if we can download files.
    • ini

      public int ini()
    • cleanFolder

      public void cleanFolder()
      Delete all unnecesary folders and files.
    • iniStable

      private void iniStable(boolean allowedDownolad)
      Initialize stable missing folder.
      Parameters:
      allowedDownolad - true if we can download files.
    • iniTemporary

      private void iniTemporary()
      Initialize temporary missing folder.
    • iniRessourcesPacks

      private void iniRessourcesPacks()
      Initialize resourcesPacks missing folder.
    • downloadData

      public void downloadData()
      Download main data from github release.
      It need Main.version to be correct to work.
    • prepareDownloadData

      private void prepareDownloadData()
      Do pre download action.
    • unzipAndCleanDownloadData

      private boolean unzipAndCleanDownloadData()
      Do post download action.
    • needToUpdateDataVersion

      public boolean needToUpdateDataVersion()
      Return true if data version is outdated or overdated.
      Each game version have 1 linked data version, so we need to know witch one. Data don't need to be update as many times as game is, so when a new version of data is needed it is publish in github action. A new data version always take curent game version as version number.
    • newVersionAviable

      public boolean newVersionAviable()
      Return true if a new version is aviable.
      If last stable version > curent version.
    • isOver

      public boolean isOver(String v1, String v2)
      Return true if v1 > v2.
    • getCurentVersion

      public String getCurentVersion()
      Return the version that game have.
    • getCurentDataVersion

      public String getCurentDataVersion()
      Return the curent data version that game have.
    • getCurentMusicVersion

      public String getCurentMusicVersion()
      Return the curent music version that game have.
    • getWantedDataVersion

      public String getWantedDataVersion()
      Return the data version that game want to have.
    • getWantedMusicVersion

      public String getWantedMusicVersion()
      Return the music version that game want to have.
    • getLastStableVersion

      public String getLastStableVersion()
      Return the last stable version downloadable on the web site.
    • getXVersion

      public String getXVersion(Path pathToJson, String nameOfTheVersion)
      Return the version from path & name of the wanted version.
      If it fail, it will return a defaut version.
      Parameters:
      pathToJson - path to the .json file taht containt version
      nameOfTheVersion - name of the version
      Returns:
      a version String as 1.49.12
    • getVersionPath

      public static Path getVersionPath(String fileName)
      return the path to version.x.
    • getVersionMdPath

      public static Path getVersionMdPath()
      return the path to version.md.
      Curent version is in version.md.
    • getVersionJsonPath

      public static Path getVersionJsonPath()
      return the path to version.json.
    • downloadMusicData

      public void downloadMusicData()
      Download music data from github release.
      It need Main.version to be correct to work.