chemaxon.util
Class DotfileUtil

java.lang.Object
  extended by chemaxon.util.DotfileUtil

public class DotfileUtil
extends java.lang.Object

Utility class for configuration file handling.

Since:
Marvin 3.0, 12/16/2002
Version:
3.0, 12/18/2002
Author:
Peter Csizmadia

Constructor Summary
DotfileUtil()
           
 
Method Summary
static java.io.OutputStream create(java.lang.String f)
          Opens a dotfile for writing.
static java.io.File getDotDir()
          Gets the directory of the configuration files.
static java.lang.String getDotDirName()
          Gets the subdirectory name of the configuration files.
static java.io.File getDotFile(java.lang.String relpath)
          Gets a configuration file with the specified relative path.
static java.io.File getDotFileWithEnsuredPath(java.lang.String relpath)
           
static long lastModified(java.lang.String f)
          Gets the last modification time for a dotfile.
static void main(java.lang.String[] args)
          Print the ChemAxon dotdir absolute path.
static java.io.InputStream open(java.lang.String f)
          Opens a dotfile for reading.
static void setDotDirName(java.lang.String d)
          Sets the subdirectory name for the configuration files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotfileUtil

public DotfileUtil()
Method Detail

getDotDir

public static java.io.File getDotDir()
Gets the directory of the configuration files.

Returns:
the directory

getDotFile

public static java.io.File getDotFile(java.lang.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
See Also:
getDotDir()

getDotFileWithEnsuredPath

public static java.io.File getDotFileWithEnsuredPath(java.lang.String relpath)
                                              throws java.io.IOException
Throws:
java.io.IOException

create

public static java.io.OutputStream create(java.lang.String f)
                                   throws java.io.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:
java.io.IOException - cannot create directory or file

open

public static java.io.InputStream open(java.lang.String f)
                                throws java.io.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:
java.io.IOException - cannot create directory or file

lastModified

public static long lastModified(java.lang.String f)
Gets the last modification time for a dotfile.

Parameters:
f - the dotfile
Returns:
the last modification time

getDotDirName

public static java.lang.String getDotDirName()
Gets the subdirectory name of the configuration files.

Returns:
the directory name

setDotDirName

public static void setDotDirName(java.lang.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

main

public static void main(java.lang.String[] args)
Print the ChemAxon dotdir absolute path.