public LoaderRepositoryFactory(String appId) { assert appId != null; Platform platform = PlatformFactory.getPlatform(); File baseDir = platform.getApplicationDataDir(appId); this.baseDir = baseDir; }
/** * Returns the Platform instance corresponding with the current platform. */ public static Platform getPlatform() { return getInstance().platform; }
/** * Returns the Platform instance corresponding with the current platform. */ public static PlatformFactory getInstance() { if (sharedInstance == null) { sharedInstance = new PlatformFactory(); } return sharedInstance; }
public String getRelativeApplicationDataDir(String applicationName) { return getRelativeApplicationDataDir(applicationName, dataDirPreserveCase(), dataDirReplaceWhitespace(), dataDirReplaceColon()); }
public String getRelativeApplicationDataDir(String applicationName) { return getRelativeApplicationDataDir(applicationName, dataDirPreserveCase(), dataDirReplaceWhitespace(), dataDirReplaceColon()); }
public ProcessLauncher(ArrayList<?> commandList, File baseDir) { this(toStringArray(commandList), baseDir); }
private PlatformFactory() { platform = createPlatform(); }
public final File getOSApplicationDataDir(String applicationName) { return new File(getOSApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
public final File getOSApplicationDataDir(String applicationName) { return new File(getOSApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
public final File getApplicationDataDir(String applicationName) { return new File(getApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
public final File getApplicationDataDir(String applicationName) { return new File(getApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
private static File getDataDir(String appId) { Platform platform = PlatformFactory.getPlatform(); return platform.getApplicationDataDir(appId); }
/** * Returns the Platform instance corresponding with the current platform. */ public static Platform getPlatform() { return getInstance().platform; }
/** * Returns the Platform instance corresponding with the current platform. */ public static PlatformFactory getInstance() { if (sharedInstance == null) { sharedInstance = new PlatformFactory(); } return sharedInstance; }
public ProcessLauncher(ArrayList<?> commandList, File baseDir) { this(toStringArray(commandList), baseDir); }
private PlatformFactory() { platform = createPlatform(); }
public static void main(String[] args) { System.out.println(getPlatform().getApplicationDataDir("My Application: Test").getAbsolutePath()); } }
public static void main(String[] args) { System.out.println(getPlatform().getApplicationDataDir("My Application: Test").getAbsolutePath()); } }
/** * Configure the data dir. * * @param dataDirParam * the data dir to use. If null, determination of the data dir will be * deferred to Platform. */ private void configureDataDir() { if (dataDirName != null) { dataDirName = dataDirName.trim(); if (!(dataDirName.equals(""))) { File dataDirCandidate = new File(dataDirName); dataDirCandidate.mkdirs(); // set this datadir if the previous code was succesful if (dataDirCandidate.canRead() && dataDirCandidate.canWrite()) { dataDir = dataDirCandidate; } } } if (dataDir == null) { dataDir = PlatformFactory.getPlatform().getApplicationDataDir(applicationId); } }
/** * Configure the data dir. * * @param dataDirParam * the data dir to use. If null, determination of the data dir will be * deferred to Platform. */ private void configureDataDir() { if (dataDirName != null) { dataDirName = dataDirName.trim(); if (!("".equals(dataDirName))) { final File dataDirCandidate = new File(dataDirName); dataDirCandidate.mkdirs(); // change data directory if the previous code was successful dataDir = (dataDirCandidate.canRead() && dataDirCandidate.canWrite()) ? dataDirCandidate : dataDir; } } if (dataDir == null) { dataDir = PlatformFactory.getPlatform().getApplicationDataDir(applicationId); } }