Class WorkingDirectory



  • public class WorkingDirectory
    extends java.lang.Object
    A class which helps getting OS specific information.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  WorkingDirectory.OS  
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkingDirectory​()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void delete​()
      Delete the working directory.
      static boolean deleteDirectory​(java.io.File directory)
      Deletes a directory and all its subfolders.
      static java.io.File getMapsFolder​()  
      static WorkingDirectory.OS getPlatform​()  
      static java.io.File getWorkingDirectory​()
      Creates the folder.
      static void setApplicationName​(java.lang.String applicationName)
      set a custom name, should be the name of the game
      static boolean unpackMap​(java.lang.String foldername, java.io.InputStream source)
      unpacks a map to working directory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkingDirectory

        public WorkingDirectory​()
    • Method Detail

      • setApplicationName

        public static void setApplicationName​(java.lang.String applicationName)
        set a custom name, should be the name of the game
        Parameters:
        applicationName - the name of the folder
      • getWorkingDirectory

        public static java.io.File getWorkingDirectory​()
        Creates the folder.
        Returns:
        Get the folder where the data is stored.
      • getMapsFolder

        public static java.io.File getMapsFolder​()
        Returns:
        Get the folder where the maps are stored.
        Since:
        1.2.X
      • unpackMap

        public static boolean unpackMap​(java.lang.String foldername,
                                        java.io.InputStream source)
        unpacks a map to working directory
        Parameters:
        foldername - the name of the map folder. Will be created if non existend.
        source - msut be a zip file without ".foldername" files
        Returns:
        trlue if everything went okay
        Since:
        1.3.13
      • delete

        public static void delete​()
        Delete the working directory. Game should be restarted after that.
        Since:
        WE v1.6.4
      • deleteDirectory

        public static boolean deleteDirectory​(java.io.File directory)
        Deletes a directory and all its subfolders.
        Parameters:
        directory -
        Returns:
        Since:
        WE v1.6.4