Delete a {@link Path}.

<p>
This method submits a task to delete a {@link Path} and returns immediately
after the task is submitted.
</p>

@param path path to be deleted.
762113
public void deletePath(final Path path, final boolean recursive) {
    this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Lock lock = ParallelRunner.this.locks.get(path.toString());
        lock.lock();
        try {
          HadoopUtils.deletePath(ParallelRunner.this.fs, path, recursive);
          return null;
        } finally {
          lock.unlock();
        }
      }
    }), "Delete path " + path));
  }
1139224
public static void path(@NotNull String path, @NotNull EndpointGroup endpointGroup) {
        path = path.startsWith("/") ? path : "/" + path;
        pathDeque.addLast(path);
        endpointGroup.addEndpoints();
        pathDeque.removeLast();
    }
1209176
public static Action deleteFile(final String path, final String tempDir) {
        if (path == null)
            throw new IllegalArgumentException("The path variable cannot be null");
        if (tempDir == null)
            throw new IllegalArgumentException("The tempDir variable cannot be null");

        final File tempFile = new File(tempDir, Misc.CreateUUID());
        final AtomicBoolean exists = new AtomicBoolean();
        return new Action(
            // Perform:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    File file = new File(path);
                    if (file.exists()) {
                        if (tempFile == null)
                            throw new ActionException("Cannot perform file deletion as " +
                                    "the temporary file cannot be crated.");

                        boolean success = new File(path).renameTo(tempFile);
                        exists.set(success);
                        if (success)
                            // Mark delete on exit (optional and work on Java only):
                            tempFile.deleteOnExit();
                        else
                            throw new ActionException("Cannot move file " + path +
                                    " to " + tempFile.getAbsolutePath());
                    }
                }
            },
            // Backout:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    if (exists.get()) {
                        if (!tempFile.renameTo(new File(path)))
                            throw new ActionException("Cannot move file " +
                                    tempFile.getAbsolutePath() + " to " + path);
                    }
                }
            },
            // Cleanup:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    if (exists.get()) {
                        if (tempFile.isDirectory()) {
                            if (!FileDirUtils.deleteRecursive(tempFile))
                                throw new ActionException("Cannot delete the temporary directory " +
                                        tempFile.getAbsolutePath());
                        } else {
                            if (!tempFile.delete())
                                throw new ActionException("Cannot delete the temporary file " +
                                        tempFile.getAbsolutePath());
                        }
                    }
                }
            });
    }
930854
public void updatePath(String path) {
        if (!path.contains(".") && !path.endsWith("/"))
            path += '/';
        this.path = path(path);
    }
242895
public void setPath(String path) {
        this.path = path;

        List<Token> tokens = Tokenizer.tokenize(path, true);
        int tokenCount = 0;
        for (Token t : tokens) {
            if (t.getType() != TokenType.TEXT) {
                tokenCount++;
            }
        }
        if (tokenCount > 0) {
            this.pathTokens = tokens.toArray(new Token[0]);
        } else {
            this.pathTokens = null;
        }
    }
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);
            }
        }
    }
52874
public static void deletePath(FileSystem fs, Path f, boolean recursive) throws IOException {
    if (fs.exists(f) && !fs.delete(f, recursive)) {
      throw new IOException("Failed to delete: " + f);
    }
  }
1365054
def action_delete(self, courseid, taskid, path):
        
        # normalize
        path = path.strip()
        if not path.startswith("/"):
            path = "/" + path

        wanted_path = self.verify_path(courseid, taskid, path)
        if wanted_path is None:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        # special case: cannot delete current directory of the task
        if "/" == wanted_path:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        try:
            self.task_factory.get_task_fs(courseid, taskid).delete(wanted_path)
            return self.show_tab_file(courseid, taskid)
        except:
            return self.show_tab_file(courseid, taskid, _("An error occurred while deleting the files"))
812953
public void setPathQuery(String path) {
        _uri = null;
        _path = null;
        _decodedPath = null;
        _param = null;
        _fragment = null;
        if (path != null)
            parse(State.PATH, path, 0, path.length());
    }
782250
public static boolean del(Path path) throws IORuntimeException {
		if (Files.notExists(path)) {
			return true;
		}

		try {
			if (Files.isDirectory(path)) {
				Files.walkFileTree(path, new SimpleFileVisitor<Path>() {

					@Override
					public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
						Files.delete(file);
						return FileVisitResult.CONTINUE;
					}

					@Override
					public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
						if (e == null) {
							Files.delete(dir);
							return FileVisitResult.CONTINUE;
						} else {
							throw e;
						}
					}
				});
			} else {
				Files.delete(path);
			}
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
		return true;
	}
1346058
@Nullable
    public File deleteFile(@NotNull final Transaction txn, @NotNull final String path) {
        final ArrayByteIterable key = StringBinding.stringToEntry(path);
        final ByteIterable fileMetadata;
        try (Cursor cursor = pathnames.openCursor(txn)) {
            fileMetadata = cursor.getSearchKey(key);
            if (fileMetadata != null) {
                cursor.deleteCurrent();
            }
        }
        if (fileMetadata != null) {
            final File result = new File(path, fileMetadata);
            // at first delete contents
            try (ClusterIterator iterator = new ClusterIterator(this, txn, result)) {
                while (iterator.hasCluster()) {
                    iterator.deleteCurrent();
                    iterator.moveToNext();
                }
            }
            return result;
        }
        return null;
    }
971687
public function delete($path, $_path='/') {
		if(!headers_sent())
			setcookie($path, null, -10000, $_path);
		unset($_COOKIE[$path]);
	}
804840
private boolean delete(String path, boolean recursive) throws IOException {
    IOException te = null;
    FileSystem hdfs = getFs();
    RetryPolicy retryPolicy = new CountingRetry(MAX_TRY);
    while (retryPolicy.attempt()) {
      try {
        return hdfs.delete(new Path(path), recursive);
      } catch (IOException e) {
        LOG.warn("Attempt count {} : {}", retryPolicy.getAttemptCount(), e.getMessage());
        te = e;
      }
    }
    throw te;
  }
808561
public static Promise<Void> delete(Executor executor, Path path) {
		return ofBlockingRunnable(executor, () -> {
			try {
				Files.delete(path);
			} catch (IOException e) {
				throw new UncheckedException(e);
			}
		});
	}
37324
def delete(self, path, callback=None, timeout=None, **kwargs):  # pragma: no cover
        
        request = self.mk_request(defines.Codes.DELETE, path)

        for k, v in kwargs.items():
            if hasattr(request, k):
                setattr(request, k, v)

        return self.send_request(request, callback, timeout)
602879
protected void deletePath(IndexTreePath<E> deletionPath) {
    N leaf = getNode(deletionPath.getParentPath().getEntry());
    int index = deletionPath.getIndex();

    // delete o
    E entry = leaf.getEntry(index);
    leaf.deleteEntry(index);
    writeNode(leaf);

    // condense the tree
    Stack<N> stack = new Stack<>();
    condenseTree(deletionPath.getParentPath(), stack);

    // reinsert underflow nodes
    while(!stack.empty()) {
      N node = stack.pop();
      if(node.isLeaf()) {
        for(int i = 0; i < node.getNumEntries(); i++) {
          settings.getOverflowTreatment().reinitialize(); // Intended?
          this.insertLeafEntry(node.getEntry(i));
        }
      }
      else {
        for(int i = 0; i < node.getNumEntries(); i++) {
          stack.push(getNode(node.getEntry(i)));
        }
      }
      deleteNode(node);
    }
    postDelete(entry);

    doExtraIntegrityChecks();
  }
1347387
public void delete(String path) {
        OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_DELETE_URL);
        request.addQuerystringParameter("root", "dropbox");
        request.addQuerystringParameter("path", encode(path));

        service.signRequest(accessToken, request);
        checkDelete(request.send());
    }