Class ContextBase

java.lang.Object
org.ampere.base.util.ContextBase
All Implemented Interfaces:
ContextDefinition, PACTEdef

public class ContextBase extends Object implements PACTEdef, ContextDefinition
Configuration and environnement management
Author:
hmorel
  • Field Details

  • Constructor Details

    • ContextBase

      protected ContextBase()
  • Method Details

    • getSingleton

      public static ContextBase getSingleton()
    • setDefaultOutput

      public static void setDefaultOutput(PrintWriter out)
    • getDefaultOutput

      public static PrintWriter getDefaultOutput()
    • isSystemConfigurated

      public boolean isSystemConfigurated(boolean validated)
    • isLocalConfigurated

      public boolean isLocalConfigurated(boolean validated)
    • isConfigurated

      public boolean isConfigurated()
    • setLocalPacteTest

      public void setLocalPacteTest(File ptest)
    • getSystemPactePropertyFile

      public File getSystemPactePropertyFile()
    • getDataDirectory

      public static File getDataDirectory()
    • getExampleDirectory

      public static File getExampleDirectory()
    • getPacteHome

      public File getPacteHome()
      PACTE HOME directory is the installation directory that containts data directory.
      Returns:
      the PACTE home directory
    • getPacteTest

      public File getPacteTest()
      PACTE TEST directory is the local directory that containts test, examples and test data directories.
      Returns:
      the PACTE test directory
    • getLibDir

      public File getLibDir()
      Returns:
      the local library directory.
    • getResource

      public static File getResource(int res)
    • getInputSource

      public static InputSource getInputSource(int res)
    • getOSname

      public static String getOSname(int osCode)
    • getConfigType

      public String getConfigType(boolean system)
    • getUserDir

      public static File getUserDir()
      Returns:
      the current user directory
    • getDataUserDir

      public static File getDataUserDir()
      Returns:
      the masked PACTEdef directory in the user directory
    • matchRelativePath

      public static boolean matchRelativePath(String relative, String absolute)
      test if a relative path matches an absolute one

      Parameters:
      relative - relative input path
      absolute - absolute input path
      Returns:
      true if both pathes match
    • getTestDataDirectory

      public static File getTestDataDirectory()
      Returns:
      the test data directory, for debugging purpose
    • register

      public static void register(String feature, String classPath, String function)
      Register a feature use in a given method
      Parameters:
      feature - considered feature
      classPath - associated class path
      function - associated function
    • startLog

      public void startLog()
    • logMessage

      public void logMessage(String message)
    • verifyConfig

      public static void verifyConfig()
      Verify the PACTE configuration