private static String getBackupPath(String destPath) { String backupPath = destPath; do { backupPath += ".bak"; } while (Util.fileExists(backupPath)); return backupPath; }
/** * {@inheritDoc} * * Method to determine if a file with the given path already exists. */ @Override protected boolean exists(String path) { return Util.fileExists(path); }
/** * Method to determine if a file with the given path already exists. * * @param path File path * @return True, if such file exists, false otherwise. */ protected boolean exists(String path) { return Util.fileExists(path); }
private static String getBackupPath(String destPath) { StringBuilder backupPath = new StringBuilder(destPath); do { backupPath.append( ".bak"); } while (Util.fileExists(backupPath.toString())); return backupPath.toString(); }
private boolean lazyCheck() { // redraw if lazy option is not set or file does not exist if (!gdef.lazy || !Util.fileExists(gdef.filename)) { return false; // 'false' means 'redraw' } // redraw if not enough time has passed long secPerPixel = (gdef.endTime - gdef.startTime) / gdef.width; long elapsed = Util.getTimestamp() - Util.getLastModified(gdef.filename); return elapsed <= secPerPixel; }
private boolean lazyCheck() { // redraw if lazy option is not set or file does not exist if (!gdef.lazy || !Util.fileExists(gdef.filename)) { return false; // 'false' means 'redraw' } // redraw if not enough time has passed long secPerPixel = (gdef.endTime - gdef.startTime) / gdef.width; long elapsed = Util.getTimestamp() - Util.getLastModified(gdef.filename); return elapsed <= secPerPixel; }