Code example for File

Methods: renameTo

0
     
    public static void stopLogging() { 
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss",Locale.getDefault());
        String currentDateandTime = sdf.format(new Date());
        if (logFile != null) {
            logFile.renameTo(new File(folder+File.separator+"Owncloud_"+currentDateandTime+".log"));
           
            isEnabled = false;
            try { 
                buf.close();
            } catch (IOException e) {
                e.printStackTrace();
            }  
         
        } 
         
    } 
     
    private static void appendPhoneInfo() { 
        appendLog("Model : " + android.os.Build.MODEL);
Contextual code suggestions in your IDE  Get Codota for Java