Code example for File

Methods: exists, getAbsolutePath, mkdirs

0
 
	public ConnectionLog() 
	  throws IOException 
	{ 
		File sdcard = Environment.getExternalStorageDirectory();
        File logDir = new File(sdcard, "tokudu/log/");
        if (!logDir.exists()) {
        	logDir.mkdirs();
        	// do not allow media scan 
            new File(logDir, ".nomedia").createNewFile();
        }         
		 
		open(logDir.getAbsolutePath() + "/push.log");
	} 
 
	public ConnectionLog(String basePath)
	  throws IOException 
	{ 
		open(basePath);
	}