static public String makeStandardFilename ( String appName , String storeName ) { // the directory String userHome = null ; try { userHome = System . getProperty ( "user.home" ) ; } catch ( Exception e ) { System . out . println ( "XMLStore.makeStandardFilename: error System.getProperty(user.home) " + e ) ; } if ( null == userHome ) userHome = "." ; String dirFilename = userHome + "/" + appName ; File f = new File ( dirFilename ) ; if ( ! f . exists ( ) ) { boolean ok = f . mkdirs ( ) ; // now ready for file creation in writeXML if ( ! ok ) System . out . println ( "Error creating directories: " + f . getAbsolutePath ( ) ) ; } return dirFilename + "/" + storeName ; }
Convenience routine for creating an XMLStore file in a standard place .