Move the path to trash as the owner of the path.
@param path {@link org.apache.hadoop.fs.Path} to move.
@return true if the move succeeded.
@throws IOException
359543
public boolean moveToTrashAsOwner(Path path) throws IOException {
    String owner = this.fs.getFileStatus(path).getOwner();
    return moveToTrashAsUser(path, owner);
  }
1151883
synchronized void removeWriter(Path path) throws IOException {
    WriterInfo val = writerList.get(path);
    if (val != null) {
      LOG.info("Unregeristering writer for path " + path.toString());
      writerList.remove(path);
      totalAllocation -= val.allocation;
      updateScale(false);
    }
  }
1318053
public static synchronized void chdir(String path) {
		if (path != null) {
			rootDir = new File(getAbsolutePath(path)).getAbsolutePath();
		}
	}
1331432
private void cleanIndexDirectory(String path) throws IOException
   {
      SecurityHelper.doPrivilegedIOExceptionAction((PrivilegedExceptionAction<Void>) () -> {
         File newIndexFolder = new File(path);
         if(newIndexFolder.exists())
         {
            DirectoryHelper.removeDirectory(newIndexFolder);
         }
         return null;
      });
   }
907199
public void redirect(String path) throws IOException
    {
        //response.setHeader("Location", path.charAt(0)=='/' ? path : "/"+path);
        response.sendRedirect(path.charAt(0)=='/' ? path : "/"+path);
        output.close();
    }
657056
public static void moveToTrash(FileSystem fs, Path path) throws IOException {
    Trash trash = new Trash(fs, new Configuration());
    trash.moveToTrash(path);
  }
1075440
public static void moveFile(@NotNull Path from, @NotNull Path to) throws IOException {
		Validate.isTrue(isFileExists(from), "%s is not exist or not a file", from);
		Validate.notNull(to);
		Validate.isTrue(!isDirExists(to), "%s is  exist but it is a dir", to);

		Files.move(from, to);
	}
910767
public static void deleteFilePath(FilePath workspace, String path) throws IOException {
        if (StringUtils.isNotBlank(path)) {
            try {
                FilePath propertiesFile = new FilePath(workspace, path);
                propertiesFile.delete();
            } catch (Exception e) {
                throw new IOException("Could not delete temp file: " + path);
            }
        }
    }
1026848
public static void deleteDirIfExists(UnderFileSystem ufs, String path) throws IOException {
    if (ufs.isDirectory(path)
        && !ufs.deleteDirectory(path, DeleteOptions.defaults().setRecursive(true))) {
      throw new IOException("Folder " + path + " already exists but can not be deleted.");
    }
  }
30325
public void deletePath(String path) {
        if (path == null) {
            return;
        }
        String[] pathComponents = path.split("/");
        TrieNode parent = rootNode;
        String part = null;
        if (pathComponents.length <= 1) {
            throw new IllegalArgumentException("Invalid path " + path);
        }
        for (int i=1; i<pathComponents.length; i++) {
            part = pathComponents[i];
            if (parent.getChild(part) == null) {
                //the path does not exist
                return;
            }
            parent = parent.getChild(part);
            LOG.info(parent);
        }
        TrieNode realParent  = parent.getParent();
        realParent.deleteChild(part);
    }
1156201
public boolean isHubPath(String path) throws IOException {
        if ("/".equals(path))
            return true;
        for (String root : getNonHubRoots()) {
            if (root.startsWith("*")) {
                if (path.endsWith(root.substring(1)))
                    return false;
            }
            else if (path.equals(root) || path.startsWith(root + "/")) {
                return false;
            }
        }
        return true;
    }
58590
public void writeToFile(String path) {
        try {
            try (OutputStream os = new FileOutputStream(path)) {
                InputStreams.transferTo(body(), os);
            }
        } catch (IOException e) {
            throw new RequestsException(e);
        } finally {
            close();
        }
    }
913056
public function move($path)
    {
        if($this->isDirectory()){
            return false;
        }
        $path = $this->relativeToAbsolute($path);
        if (($ret = @rename($this->filePath, $path)) === true) {
            $this->filePath = $path;
        }

        return $ret;
    }
1117810
def move(self, path, destination):
        
        args = {
            'path': path,
            'destination': destination,
        }

        return self._client.json('filesystem.move', args)
54774
private boolean moveParserToField(JsonParser parser, String path)
            throws IOException {
        List<String> segments = getFieldPath(path);

        for (String segment : segments) {
            if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
                // Always expect the path to be fields in a JSON map
                return false;
            }

            boolean found = false;

            JsonToken currentToken = parser.nextToken();
            while (!found && currentToken != JsonToken.END_OBJECT) {
                if (currentToken != JsonToken.FIELD_NAME) {
                    // This should always be a field.  Something is amiss.
                    throw new IOException("Field not found at expected location");
                }
                String fieldName = parser.getText();
                if (fieldName.equals(segment)) {
                    // Move to the next token, which is the field value
                    found = true;
                    currentToken = parser.nextToken();
                } else {
                    parser.nextValue();
                    currentToken = skipValue(parser);
                }
            }

            if (!found) {
                // Field was not found
                return false;
            }
        }

        // The current location in the parser is the value.
        return true;
    }
899476
@Override
  public boolean moveToTrashAsUser(Path path, final String user) throws IOException {
    return getUserTrash(user).moveToTrash(path);
  }
992313
public static void removeEntry(final File zip, final String path) {
    operateInPlace(zip, new InPlaceAction() {
      public boolean act(File tmpFile) {
        removeEntry(zip, path, tmpFile);
        return true;
      }
    });
  }