Deletes the resources for a given instance.
@param instance an instance
@throws IOException if resources could not be deleted
11131
public static void deleteInstanceResources( Instance instance )	throws IOException {
		File dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
		Utils.deleteFilesRecursively( dir );
	}
843144
public static void deleteFiles(final File file) throws IOException
	{
		final File[] ff = file.listFiles();
		if (ff != null)
		{
			for (final File f : ff)
			{
				DeleteFileExtensions.delete(f);
			}
		}
	}
143745
public void remove(Class<? extends T> type) throws IOException {
        for (T t : data) {
            if(t.getClass()==type) {
                data.remove(t);
                onModified();
                return;
            }
        }
    }
41787
public void delete() throws IOException, InterruptedException {
        // Access to file must be closed before deleting.
        rwfile.close();

        file.delete();

        // Wait until file has been deleted (deletes are asynchronous on Windows!) otherwise we
        // might shutdown the server and prevent another one from starting.
        for (int i = 0; i < 10 && file.exists(); i++) {
            Thread.sleep(1000);
        }
        if (file.exists()) {
            throw new IOException("Failed to delete file.");
        }
    }
256697
public static base_response delete(nitro_service client, String id) throws Exception {
		linkset deleteresource = new linkset();
		deleteresource.id = id;
		return deleteresource.delete_resource(client);
	}
955842
public static void delete(final Collection<File> files) throws IOException
	{
		for (final File file : files)
		{
			delete(file);
		}
	}
1188642
def delete_instance(self, credentials, name, **kwargs):
        """"""
        op_name = delete_instance(
            credentials, self.project, self.zone, name, **kwargs)

        return op_name
173122
def delete_file(self, instance, sender, **kwargs):
        
        file_ = getattr(instance, self.attname)

        # If no other object of this type references the file, and it's not the
        # default value for future objects, delete it from the backend.
        query = Q(**{self.name: file_.name}) & ~Q(pk=instance.pk)
        qs = sender._default_manager.filter(query)

        if (file_ and file_.name != self.default and not qs):
            default.backend.delete(file_)
        elif file_:
            # Otherwise, just close the file, so it doesn't tie up resources.
            file_.close()
557227
@Override
    public void removeInstance(long key, T instance) {
    	if (first.value == key && instance == first.element) {
    		removeMin();
    		return;
    	}
    	if (last.value == key && instance == last.element) {
    		removeMax();
    		return;
    	}

    	// if both children of root are black, set root to red
    	if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
            root.red = true;

        root = removeInstance(root, key, instance);
        if (root != null) root.red = false;
    }
152788
public static void shutdown(HazelcastInstance instance) {
        if (instance instanceof HazelcastClientProxy) {
            final HazelcastClientProxy proxy = (HazelcastClientProxy) instance;
            HazelcastClientInstanceImpl client = proxy.client;
            if (client == null) {
                return;
            }
            proxy.client = null;
            CLIENTS.remove(client.getName());

            try {
                client.shutdown();
            } catch (Throwable ignored) {
                EmptyStatement.ignore(ignored);
            } finally {
                OutOfMemoryErrorDispatcher.deregisterClient(client);
            }
        }
    }
1174845
public static base_response delete(nitro_service client, Long clid) throws Exception {
		clusterinstance deleteresource = new clusterinstance();
		deleteresource.clid = clid;
		return deleteresource.delete_resource(client);
	}
1200461
def clear_instances(self, instances=None):
        
        if instances is None:
            instances = self.instances[:]  # have to make a copy of the list
        for instance in instances:
            self.remove_instance(instance)
952096
def remove_instance(self, item):
        """"""
        self.instances.remove(item)
        self.remove_item(item)
1269312
public void delete() throws IOException {
        String idKey = idStrategy().keyFor(id);
        File existingUserFolder = getExistingUserFolder();
        UserIdMapper.getInstance().remove(id);
        AllUsers.remove(id);
        deleteExistingUserFolder(existingUserFolder);
        UserDetailsCache.get().invalidate(idKey);
    }
1343828
public static function delete($instance)
	{
		$class = get_called_class();

		if ($instance === true)
		{
			static::$_instances[$class] = array();

			return true;
		}
		elseif (static::exists($instance))
		{
			unset(static::$_instances[$class][$instance]);

			return true;
		}

		return false;
	}
74625
protected static void removeInstance( Object instance ) {
      Set set = getCycleSet();
      set.remove( instance );
      if(set.size() == 0) {
          cycleSet.remove();
      }
   }
1155176
public void delete() throws IOException {
        close();
        if (osFile != null) {
            boolean deleted = osFile.delete();
            while (!deleted) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                    logger.error("{} not deleted.", osFile);
                }
                System.gc();
                deleted = osFile.delete();
            }
        }
    }