Package chemaxon.util

Class DotfileUtil

java.lang.Object
chemaxon.util.DotfileUtil

@PublicAPI public class DotfileUtil extends Object
Utility class for configuration file handling.
Since:
Marvin 3.0, 12/16/2002
  • Constructor Details

    • DotfileUtil

      public DotfileUtil()
  • Method Details

    • getDotDir

      public static File getDotDir()
      Gets the directory of the configuration files.
      Returns:
      the directory
    • getDotFile

      public static File getDotFile(String relpath)
      Gets a configuration file with the specified relative path. The specified relative path must be in unix style, with slash ("/") characters as file separator.
      Parameters:
      relpath - relative path
      Returns:
      the file
      See Also:
    • getDotFileWithEnsuredPath

      public static File getDotFileWithEnsuredPath(String relpath) throws IOException
      Throws:
      IOException
    • create

      public static OutputStream create(String f) throws IOException
      Opens a dotfile for writing. Creates directory if it does not exist. The specified relative path must be in unix style, with slash ("/") characters as file separator.
      Parameters:
      f - the dotfile
      Returns:
      the output stream
      Throws:
      IOException - cannot create directory or file
    • open

      public static InputStream open(String f) throws IOException
      Opens a dotfile for reading. The specified relative path must be in unix style, with slash ("/") characters as file separator.
      Parameters:
      f - the dotfile
      Returns:
      the output stream
      Throws:
      IOException - cannot create directory or file
    • lastModified

      public static long lastModified(String f)
      Gets the last modification time for a dotfile.
      Parameters:
      f - the dotfile
      Returns:
      the last modification time
    • getDotDirName

      public static String getDotDirName()
      Gets the subdirectory name of the configuration files.
      Returns:
      the directory name
    • setDotDirName

      public static void setDotDirName(String d)
      Sets the subdirectory name for the configuration files. The specified relative path must be in unix style, with slash ("/") characters as file separator.
      Parameters:
      d - the subdirectory name