All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jlot.client.configuration.UserHomeDirectory Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy