Deletes a Pairtree version file.

@param aFuture The result of an action that may, or may not, have occurred yet.
557642
private void deleteVersion(final Future<Void> aFuture) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(MessageCodes.PT_DEBUG_006, myPath);
        }

        myFileSystem.delete(getVersionFilePath(), result -> {
            if (result.succeeded()) {
                if (hasPrefix()) {
                    deletePrefix(aFuture);
                } else {
                    aFuture.complete();
                }
            } else {
                aFuture.fail(result.cause());
            }
        });
    }
501868
private Boolean isActionNeeded(Collection<File> createdFiles, Collection<File> modifiedFiles) {
        boolean actionNeeded = false;

        for (File createdFile : createdFiles) {
            if (currentlyDeletedFiles.contains(createdFile)) {
                currentlyDeletedFiles.remove(createdFile);
                actionNeeded = true;
            }
        }

        if (modifiedFiles.isEmpty() == false) {
            actionNeeded = true;
        }
        return actionNeeded;
    }
957336
def delete(self):

		'''
		
		'''

		# send patch
		response = self.resource.repo.api.http_request('DELETE', self.uri)

		# if response 204
		if response.status_code == 204:
			logger.debug('deleting previous version of resource, %s' % self.uri)

			# remove from resource versions
			delattr(self._current_resource.versions, self.label)

		# if 400, likely most recent version and cannot remove
		elif response.status_code == 400:
			raise Exception('HTTP 400, likely most recent resource version which cannot be removed')

		else:
			raise Exception('HTTP %s, could not delete resource version: %s' % (response.status_code, self.uri))
150452
@Override
	public void listRemove(final T currentElement) throws FrameworkException {

		final T previousElement = listGetPrevious(currentElement);
		final T nextElement     = listGetNext(currentElement);

		if (currentElement != null) {

			if (previousElement != null) {
				unlinkNodes(getSiblingLinkType(), previousElement, currentElement);
			}

			if (nextElement != null) {
				unlinkNodes(getSiblingLinkType(), currentElement, nextElement);
			}
		}

		if (previousElement != null && nextElement != null) {

			Node previousNode = previousElement.getNode();
			Node nextNode     = nextElement.getNode();

			if (previousNode != null && nextNode != null) {

				linkNodes(getSiblingLinkType(), previousElement, nextElement);
			}

		}
	}
245933
public static void deleteFileIfExists(UnderFileSystem ufs, String path) {
    try {
      if (ufs.isFile(path)) {
        ufs.deleteFile(path);
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
182744
@Override
	public void deleteObjectOrCancelCheckOut(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
		objectService.deleteObject(repositoryId, objectId, allVersions, extension);
	}
1274277
public static void deleteFile(@Nonnull File f) throws IOException {
        newPathRemover(PathRemover.PathChecker.ALLOW_ALL).forceRemoveFile(fileToPath(f));
    }
851341
protected void removeVersionable() throws RepositoryException, ConstraintViolationException, VersionException
   {
      if (isNode())
      {
         NodeTypeDataManager ntManager = session.getWorkspace().getNodeTypesHolder();
         NodeData node = (NodeData)data;
         if (ntManager.isNodeType(Constants.MIX_VERSIONABLE, node.getPrimaryTypeName(), node.getMixinTypeNames()))
         {

            ItemData vhpd =
               dataManager.getItemData(node, new QPathEntry(Constants.JCR_VERSIONHISTORY, 1), ItemType.PROPERTY);
            if (vhpd != null && !vhpd.isNode())
            {
               String vhID = ValueDataUtil.getString(((PropertyData)vhpd).getValues().get(0));
               dataManager.removeVersionHistory(vhID, null, data.getQPath());
            }
            else
            {
               throw new RepositoryException("Version history not found for " + node.getQPath().getAsString());
            }
         }
      }
   }
787335
def removeItem(self, item):
        """"""
        try:
            self.tree.removeItem(item)
        except AttributeError, e:
            raise VersionError('Saved versions are immutable')
147495
private void delete(DirectoryEntry entry, DeleteMode deleteMode, JimfsPath pathForException)
      throws IOException {
    Directory parent = entry.directory();
    File file = entry.file();

    checkDeletable(file, deleteMode, pathForException);
    parent.unlink(entry.name());
    parent.updateModifiedTime();

    file.deleted();
  }
1303309
public void deleteIfMatch(URI uri, String eTag, Credentials credentials)
			throws IOException {
		deleteIfMatch(uri, eTag, null, credentials);
	}
730214
def delete_version(self, version_id=None):
        
        if not version_id:
            version_id = self.version.id

        target_url = self._client.get_url('VERSION', 'DELETE', 'single', {'layer_id': self.id, 'version_id': version_id})
        r = self._client.request('DELETE', target_url)
        logger.info("delete_version(): %s", r.status_code)
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.");
    }
  }
487913
@Override
  public void abortTask(TaskAttemptContext context) throws IOException {
    try {
      if (workPath != null) { 
        context.progress();
        if (!outputFileSystem.delete(workPath, true)) {
          LOG.warn("Deleting output in " + workPath + " returns false");
        }
      }
    } catch (IOException ie) {
      LOG.warn("Error discarding output in " + workPath, ie);
      throw ie;
    }
  }
609415
@Nonnull
  public static FileIOError deleteFile (@Nonnull final File aFile)
  {
    ValueEnforcer.notNull (aFile, "File");

    if (!FileHelper.existsFile (aFile))
      return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);

    // Is the parent directory writable?
    final File aParentDir = aFile.getParentFile ();
    if (aParentDir != null && !aParentDir.canWrite ())
      return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);

    try
    {
      Files.delete (aFile.toPath ());
      return EFileIOErrorCode.NO_ERROR.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);
    }
    catch (final NoSuchFileException ex)
    {
      return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);
    }
    catch (final DirectoryNotEmptyException ex)
    {
      return EFileIOErrorCode.OPERATION_FAILED.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);
    }
    catch (final IOException ex)
    {
      return EFileIOErrorCode.IO_ERROR.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);
    }
    catch (final SecurityException ex)
    {
      return EFileIOErrorCode.getSecurityAsIOError (EFileIOOperation.DELETE_FILE, ex);
    }
  }
905434
private static void recursiveDelete(File f) throws IOException
   {
      if (f != null && f.exists())
      {
         File[] files = f.listFiles();
         if (files != null)
         {
            for (int i = 0; i < files.length; i++)
            {
               if (files[i].isDirectory())
               {
                  recursiveDelete(files[i]);
               }
               else
               {
                  if (!files[i].delete())
                     throw new IOException("Could not delete " + files[i]);
               }
            }
         }
         if (!f.delete())
            throw new IOException("Could not delete " + f);
      }
   }
1033203
public synchronized void deleteAtExit(FileNode node) {
        if (delete == null) {
            // already exiting
            tryDelete(node);
        } else {
            delete.add(node);
        }
    }