org.jlot.client.configuration.UserHomeDirectory Maven / Gradle / Ivy
package org.jlot.client.configuration;
import java.io.File;
public class UserHomeDirectory
{
private static final String DEFAULT_PATHNAME = System.getProperty("user.home") + "/.jlot/";
private String pathname;
public UserHomeDirectory ()
{
this(DEFAULT_PATHNAME);
}
public UserHomeDirectory ( String pathname )
{
if (!pathname.endsWith("/"))
{
pathname += "/";
}
this.pathname = pathname;
init();
}
private void init ( )
{
File file = new File(pathname);
if (!file.exists())
{
file.mkdir();
}
}
public String getPathname ( )
{
return pathname;
}
public File getConfigFile ( )
{
String filename = getPathname() + "config.properties";
return new File(filename);
}
}