001 package org.hackystat.utilities.home; 002 003 import java.io.File; 004 005 /** 006 * Provides a utility that returns the desired location of the dot-hackystat directory. 007 * This defaults to the user.home System Property, but can be overridden by the user 008 * by providing the property hackystat.user.home. 009 * @author Philip Johnson 010 * 011 */ 012 public final class HackystatUserHome { 013 014 /** Make this class noninstantiable. */ 015 private HackystatUserHome() { 016 // Do nothing. 017 } 018 019 /** 020 * Return a File instance representing the desired location of the .hackystat directory. 021 * Note that this directory may or may not exist. 022 * @return A File instance representing the desired user.home directory. 023 */ 024 public static File getHome() { 025 String userHome = System.getProperty("hackystat.user.home", System.getProperty("user.home")); 026 return new File(userHome); 027 } 028 029 }