File orig_file = new File(from); try { if (!orig_file.exists()) { GLMDebug.ERROR("moveFile()", "Source file does not exist. "+from); return false; } if (!orig_file.canWrite()) { GLMDebug.ERROR("moveFile()", "Permissions problem: Cannot move file "+from); return false; } File new_file = new File(to); orig_file.renameTo(new_file);  } catch (SecurityException se) { GLMDebug.ERROR("moveFile()", "Security Exception for "+from+": "+se); return false; } return true;
File orig_file = new File(from); try { if (!orig_file.exists()) { if (logger.isErrorEnabled()) { logger.error("moveFile()" + "Source file does not exist. " + from); } return false; } if (!orig_file.canWrite()) { if (logger.isErrorEnabled()) { logger.error("moveFile()" + "Permissions problem: Cannot move file " + from); } return false; } File new_file = new File(to); orig_file.renameTo(new_file);  } catch (SecurityException se) { if (logger.isErrorEnabled()) { logger.error("moveFile()" + "Security Exception for " + from + ": " + se); } return false;
    public static boolean renameFile(String from, String to) {	// This method is actually rename file		File orig_file = new File(from);	try {	    if (!orig_file.exists()) {		GLMDebug.ERROR("moveFile()", "Source file does not exist. "+from);		return false;	    }	    if (!orig_file.canWrite()) {		GLMDebug.ERROR("moveFile()", "Permissions problem: Cannot move file "+from);		return false;	    }	    File new_file = new File(to);	    orig_file.renameTo(new_file);	    	} catch (SecurityException se) {	    GLMDebug.ERROR("moveFile()", "Security Exception for "+from+": "+se);	    return false;	}	return true;    }