Renames this job.
@deprecated Exists for backwards compatibility, use {@link #doConfirmRename} instead.
350880
@Deprecated
    @RequirePOST
    public/* not synchronized. see renameTo() */void doDoRename(
            StaplerRequest req, StaplerResponse rsp) throws IOException,
            ServletException {
        String newName = req.getParameter("newName");
        doConfirmRename(newName).generateResponse(req, rsp, null);
    }
624645
private static void setJobName(Map<String,String> map, String jobName) {
		map.put(JOB_NAME_KEY, jobName);
	}
867418
private Node renameProperty(Node propertyName) {
    checkArgument(propertyName.isString());
    if (!renameProperties) {
      return propertyName;
    }
    Node call = IR.call(
        IR.name(NodeUtil.JSC_PROPERTY_NAME_FN).srcref(propertyName),
        propertyName);
    call.srcref(propertyName);
    call.putBooleanProp(Node.FREE_CALL, true);
    call.putBooleanProp(Node.IS_CONSTANT_NAME, true);
    return call;
  }
711842
def rename(self, name):
        
        self.update(name='{} node {}'.format(name, self.nodeid))
632950
public void rename(String newName) {
        URL url = FOLDER_INFO_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");

        JsonObject updateInfo = new JsonObject();
        updateInfo.add("name", newName);

        request.setBody(updateInfo.toString());
        BoxJSONResponse response = (BoxJSONResponse) request.send();
        response.getJSON();
    }
654244
def rename(self, new_name, range=None):
        """"""
        self.log.debug('rename: in')
        if not new_name:
            new_name = self.editor.ask_input("Rename to:")
        self.editor.write(noautocmd=True)
        b, e = self.editor.word_under_cursor_pos()
        current_file = self.editor.path()
        self.editor.raw_message(current_file)
        self.send_refactor_request(
            "RefactorReq",
            {
                "typehint": "RenameRefactorDesc",
                "newName": new_name,
                "start": self.get_position(b[0], b[1]),
                "end": self.get_position(e[0], e[1]) + 1,
                "file": current_file,
            },
            {"interactive": False}
        )
737741
private boolean renameOverwrite(String oldname, String newname) {

        boolean deleted = delete(newname);

        if (exists(oldname)) {
            File file = new File(oldname);

            return file.renameTo(new File(newname));
        }

        return deleted;
    }
428872
function rename(ts, cm) {
    var token = cm.getTokenAt(cm.getCursor());
    if (!/\w/.test(token.string)) showError(ts, cm, "Not at a variable");
    dialog(cm, "New name for " + token.string, function(newName) {
      ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) {
        if (error) return showError(ts, cm, error);
        applyChanges(ts, data.changes);
      });
    });
  }
700738
@Override
  public int rename(String oldPath, String newPath) {
    final AlluxioURI oldUri = mPathResolverCache.getUnchecked(oldPath);
    final AlluxioURI newUri = mPathResolverCache.getUnchecked(newPath);
    LOG.trace("rename({}, {}) [Alluxio: {}, {}]", oldPath, newPath, oldUri, newUri);

    try {
      mFileSystem.rename(oldUri, newUri);
      synchronized (mOpenFiles) {
        if (mOpenFiles.contains(PATH_INDEX, oldPath)) {
          OpenFileEntry oe = mOpenFiles.getFirstByField(PATH_INDEX, oldPath);
          oe.setPath(newPath);
        }
      }
    } catch (FileDoesNotExistException e) {
      LOG.debug("Failed to rename {} to {}, file {} does not exist", oldPath, newPath, oldPath);
      return -ErrorCodes.ENOENT();
    } catch (FileAlreadyExistsException e) {
      LOG.debug("Failed to rename {} to {}, file {} already exists", oldPath, newPath, newPath);
      return -ErrorCodes.EEXIST();
    } catch (Throwable t) {
      LOG.error("Failed to rename {} to {}", oldPath, newPath, t);
      return AlluxioFuseUtils.getErrorCode(t);
    }

    return 0;
  }
304650
private void rename(String from, String to) throws IOException
   {
      IndexOutputStream out = null;
      IndexInputStream in = null;
      try
      {
         out = new IndexOutputStream(dir.createOutput(to));
         in = new IndexInputStream(dir.openInput(from));
         DirectoryHelper.transfer(in, out);
      }
      finally
      {
         if (in != null)
         {
            in.close();
         }

         if (out != null)
         {
            out.flush();
            out.close();
         }
      }
      try
      {
         // delete old one
         if (dir.fileExists(from))
         {
            dir.deleteFile(from);
         }
      }
      catch (IOException e)
      {
         // do noting. Will be removed later
         if (LOG.isTraceEnabled())
         {
            LOG.trace("Can't deleted file: " + e.getMessage());
         }
      }
   }
1307681
void moveToDone(final JobID id, boolean sync, final JobID renameJobId) {
    // If restarting is disabled use original implementation
    if (conf.getInt(CoronaJobTracker.MAX_JT_FAILURES_CONF,
        CoronaJobTracker.MAX_JT_FAILURES_DEFAULT) == 0) {
      moveToDone(id, sync);
      return;
    }
    // Otherwise use corona-specific implementation
    final List<Path> paths = new ArrayList<Path>();
    final Path historyFile = getHistoryFile(id);
    if (historyFile == null) {
      LOG.info("No file for job-history with " + id + " found in cache!");
    } else {
      paths.add(historyFile);
    }

    final Path confPath = getConfFileWriters(id);
    if (confPath == null) {
      LOG.info("No file for jobconf with " + id + " found in cache!");
    } else {
      paths.add(confPath);
    }

    Runnable r = new Runnable() {

      public void run() {
        // move the files to doneDir folder
        try {
          List<PrintWriter> writers = getWriters(id);
          synchronized (writers) {
            if (writers.size() > 0) {
              // try to wait writers for 10 minutes 
              writers.wait(600000L);
            }
            
            if (writers.size() > 0) {
              LOG.warn("Failed to wait for writers to finish in 10 minutes.");
            }
          }

          URI srcURI = logFs.getUri();
          URI doneURI = doneFs.getUri();
          boolean useRename = (srcURI.compareTo(doneURI) == 0);

          for (Path path : paths) {
            // check if path exists, in case of retries it may not exist
            if (logFs.exists(path)) {
              LOG.info("Moving " + path.toString() + " to " +
                  doneDir.toString());

              Path dstPath;
              if (renameJobId != null) {
                if (JobHistory.CONF_FILTER.accept(path)) {
                  dstPath = new Path(doneDir, getConfFilename(renameJobId));
                } else {
                  dstPath = new Path(doneDir, getHistoryFilename(renameJobId));
                }
              } else {
                dstPath = new Path(doneDir, path.getName());
              }

              if (useRename) {
                // In the job tracker failover case, the previous job tracker may have
                // generated the history file, remove it if existed
                if (doneFs.exists(dstPath)) {
                  LOG.info("Delete the previous job tracker generaged job history file in " +
                      dstPath);
                  doneFs.delete(dstPath, true);
                }
                doneFs.rename(path, dstPath);
              } else {
                FileUtil.copy(logFs, path, doneFs, dstPath, true, true, conf);
              }

              doneFs.setPermission(dstPath, new FsPermission(
                  CoronaJobHistory.HISTORY_FILE_PERMISSION));
            }
          }
        } catch (Throwable e) {
          LOG.error("Unable to move history file to DONE folder:\n" +
              StringUtils.stringifyException(e));
        }

        String historyFileDonePath = null;
        if (historyFile != null) {
          historyFileDonePath = new Path(doneDir, historyFile.getName())
              .toString();
        }

        JobHistory.jobHistoryFileMap.put(id, new MovedFileInfo(
            historyFileDonePath, System.currentTimeMillis()));
        jobTracker.historyFileCopied(id, historyFileDonePath);

        // purge the job from the cache
        purgeJob(id);
      }

    };

    if (sync) {
      r.run();
    } else {
      executor.execute(r);
    }
  }
1008701
function (oldPath, newPath, callback) {
	fs.rename( oldPath, newPath, function (err) {
		if (err) {
			callback( err );
		} else {
			callback( null, {
				filename: newPath.split( '/' ).pop(),
				filepath: newPath
			});
		}
	});
}
396708
def rename(old, new)
      parameters = Specification.new(
        old: Types::Tags,
        new: Types::Tags
      ).parameters(old: old, new: new)
      @client.action('/tags/rename', parameters)
      self
    end
278796
public void renameEntry(Name oldDN, Name newDN) throws NamingException
   {

      Name rdn = newDN.getSuffix(newDN.size() - 1);

      Name oldRdn = oldDN.getSuffix(oldDN.size() - 1);

      if (!oldRdn.toString().equals(rdn.toString()))

         ctx.rename(oldDN, rdn);

   }
634145
def rename(self, **kwargs):
        ''''''
        for old, new in kwargs.iteritems():
            if old in self.groups:
                self.groups[new] = self.groups[old]
                del self.groups[old]
233765
private void rename(File legacyFile, File newFile) throws IOException {
        if (!legacyFile.exists())   return;
        if (newFile.exists()) {
            Util.deleteFile(newFile);
        }
        if (!legacyFile.renameTo(newFile)) {
            LOGGER.warning("Failed to rename " + legacyFile + " to " + newFile);
        }
    }
1325543
void processAlterTableRename(Table table) {

        HsqlName name = readNewSchemaObjectName(SchemaObject.TABLE);

        name.setSchemaIfNull(table.getSchemaName());

        if (table.getSchemaName() != name.schema) {
            throw Error.error(ErrorCode.X_42505);
        }

        database.schemaManager.renameSchemaObject(table.getName(), name);
    }