Deletes a file, directory, or project.
@param {String} location The location of the file or directory to delete.
512404
function(location) {
			return this._getEntry(location).then(function(entry) {
				var d = new orion.Deferred();
				var remove = (entry.removeRecursively) ? "removeRecursively" : "remove";
				entry[remove](function() {d.resolve();}, d.reject);
				return d;
			});
		}
1344158
function remove(file, options, done) {
    if (arguments.length === 2 && 'function' === typeof options) {
        done = options;
        options = {};
    }

    if ('function' !== typeof done) {
        done = function() {};
    }

    function callfile(file, stats, done) {
        fs.unlink(file, done);
    }

    function calldir(dir, stats, files, state, done) {
        if (state === 'end') {
            if (options.empty && dir === file) {
                done();
            } else {
                if (stats.isSymbolicLink()) {
                    fs.unlink(dir, done);
                } else {
                    fs.rmdir(dir, function(er) {
                        if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {
                            // try in few time, last deletion is not completely ended
                            setTimeout(function() {
                                fs.rmdir(dir, done);
                            }, 10);
                        } else {
                            done(er);
                        }
                    });
                }
            }
        } else {
            done();
        }
    }

    options = Object.assign({
        fs: fs,
        resolve: true,
        followSymlink: false
    }, options);

    _explore(file, callfile, calldir, options, done);
}
748058
function deleteProject(project) {
	return project.delete()
	.catch((error) => {
		console.error("Project with ID: " + project.id + " couldn't be deleted.");
		console.trace(error);
		throw error;
	});
}
1036539
function removeFile (project_dir, src) {
    var file = path.resolve(project_dir, src);
    shell.rm('-Rf', file);
}
750245
@Deprecated
  public void deleteLocalFiles() throws IOException {
    String[] localDirs = getLocalDirs();
    for (int i = 0; i < localDirs.length; i++) {
      FileSystem.getLocal(this).delete(new Path(localDirs[i]));
    }
  }
1107963
public static void deleteDirectory(File fileOrDirectory) {
        if (fileOrDirectory.isDirectory())
            for (File child : fileOrDirectory.listFiles())
                deleteDirectory(child);

        fileOrDirectory.delete();
    }
848254
function deleteIt(fs, p, method, cb) {
    fs.metadata(p)
    .then(function(metadata) {
        if (!metadata.is_dir) {
            throw fs.error('ENOTDIR');
        }

        return fs.list(p)
        .then(function(list) {
            return when.all(list.map(function(metadata) {
                if (metadata.is_dir) {
                    return resolveDelete(fs, p + '/' + metadata.name, method);
                } else {
                    return fs.delete(p + '/' + metadata.name);
                }
            }));
        })
        .then(function() {
            return fs._promise(method, p);
        });
    })
    .done(cb, cb);
}
143535
function (identifier)  {
    var path;
    if (identifier) {
      path = this.constructPath(constants.LOCATIONS, identifier);
      return this.Core.DELETE(path);
    } else {
      return this.rejectRequest('Bad Request: A location identifier is required.');
    }
  }
840258
@SuppressWarnings("ResultOfMethodCallIgnored")
    static private void deleteDirectory(File path) {
        if (path.exists()) {
            //noinspection ConstantConditions
            for (File f : path.listFiles()) {
                if (f.isDirectory()) {
                    deleteDirectory(f);
                }
                f.delete();
            }
            path.delete();
        }
    }
30363
public void cleanDirectory( final File directory )
        throws IOException
    {
        if ( !directory.exists() )
        {
            final String message = directory + " does not exist";
            throw new IllegalArgumentException( message );
        }

        if ( !directory.isDirectory() )
        {
            final String message = directory + " is not a directory";
            throw new IllegalArgumentException( message );
        }

        Delete deleteTask = new Delete();
        deleteTask.setProject(getProject());
		deleteTask.setDir(directory);
		deleteTask.execute();
		
		if(!directory.exists()){
			directory.mkdirs();
		}
    }
892127
public function removeLocation(\CampaignChain\CoreBundle\Entity\Location $location)
    {
        $this->locations->removeElement($location);
    }
714684
public function deleteLocation(Location $location)
    {
        $this->service->deleteLocation($location);
        $this->signalDispatcher->emit(
            new DeleteLocationSignal(
                array(
                    'contentId' => $location->contentId,
                    'locationId' => $location->id,
                    'parentLocationId' => $location->parentLocationId,
                )
            )
        );
    }
332094
function(startDir) {
					var i, j, empty, stat;
					for (i in cache) {
						empty = true;
						if (i.indexOf(options.baseUrl) > -1) {
							this.deleteFile(i);
							continue;
						}

						stat = cache[i].stat;

						if (stat.isDirectory()) {
							for (j in cache) {
								if (j.indexOf(i) > -1) {
									empty = false;
									break;
								}
							}

							if (empty) {
								this.deleteFile(i);
							}
						}
					}
				}
622507
public function delete($location, $body = null)
    {
        curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE");

        if ($body) {
            curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        }

        return $this->execute('DELETE', $location);
    }
795343
function(place) {
				place = place? place : (list ? cwd.find('tbody') : cwd);
				var targets = place.children('.directory:not(.'+clDroppable+',.elfinder-na,.elfinder-ro)');

				if (fm.isCommandEnabled('paste')) {
					targets.droppable(droppable);
				}
				if (fm.isCommandEnabled('upload')) {
					targets.addClass('native-droppable');
				}
				
				place.children('.isroot').each(function(i, n) {
					var $n   = $(n),
						hash = fm.cwdId2Hash(n.id);
					
					if (fm.isCommandEnabled('paste', hash)) {
						if (! $n.hasClass(clDroppable+',elfinder-na,elfinder-ro')) {
							$n.droppable(droppable);
						}
					} else {
						if ($n.hasClass(clDroppable)) {
							$n.droppable('destroy');
						}
					}
					if (fm.isCommandEnabled('upload', hash)) {
						if (! $n.hasClass('native-droppable,elfinder-na,elfinder-ro')) {
							$n.addClass('native-droppable');
						}
					} else {
						if ($n.hasClass('native-droppable')) {
							$n.removeClass('native-droppable');
						}
					}
				});
			}
1159900
public static void deleteDirectories(FileSystem fs, List<String> directoriesToDelete, boolean recursive, boolean moveToTrash) throws IOException {
    for (String directory : directoriesToDelete) {
      if (moveToTrash) {
        moveToTrash(fs, new Path(directory));
      } else {
        deletePath(fs, new Path(directory), recursive);
      }
    }
  }
323672
function( file ) {
                var me = this,
                    existing = this._map[ file.id ];
    
                if ( existing ) {
                    delete this._map[ file.id ];
                    file.destroy();
                    this.stats.numofDeleted++;
                }
            }