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 Summary
Constructors Constructor Description DotfileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OutputStream
create(String f)
Opens a dotfile for writing.static File
getDotDir()
Gets the directory of the configuration files.static String
getDotDirName()
Gets the subdirectory name of the configuration files.static File
getDotFile(String relpath)
Gets a configuration file with the specified relative path.static File
getDotFileWithEnsuredPath(String relpath)
static long
lastModified(String f)
Gets the last modification time for a dotfile.static void
main(String[] args)
Print the ChemAxon dotdir absolute path.static InputStream
open(String f)
Opens a dotfile for reading.static void
setDotDirName(String d)
Sets the subdirectory name for the configuration files.
-
-
-
Method Detail
-
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:
getDotDir()
-
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
-
main
public static void main(String[] args)
Print the ChemAxon dotdir absolute path.- Parameters:
args
- args
-
-