Removes the Attachment specified by the attachmentId.

@param attachmentId id of attachment to remove
@return removed Attachment or null if one was not found with the id
969193
public Attachment removeAttachment(final long attachmentId) {
        Attachment removedAttachment = null;

        if (attachments != null) {
            for (int index = attachments.size() - 1; index >= 0; --index) {
                Attachment currentAttachment = attachments.get(index);

                if (currentAttachment.getId() == attachmentId) {
                    removedAttachment = attachments.remove(index);
                    break;
                }
            }
        }

        return removedAttachment;
    }
842067
public Object remove(int index) {
        return index >= 0 && index < this.length()
            ? this.myArrayList.remove(index)
            : null;
    }
19208
public static function getAttachment($attachmentID,$options = [])
    {
        $result     = null;
        $downloader = new Priloha($attachmentID,$options);
        if ($downloader->lastResponseCode == 200) {

            $downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
            if ($downloader->lastResponseCode == 200) {
                $result = $downloader->lastCurlResponse;
            }
        }
        return $result;
    }
885223
public static boolean deleteAttachment(Attachment attachment) {
        File attachmentFile = new File(getResultsDirectory(), attachment.getSource());
        return attachmentFile.exists() && attachmentFile.canWrite() && attachmentFile.delete();
    }
1337766
public void removeDevice(String id) throws UnknownDeviceException, NullIdException {
		if ((id == null) || (id.trim().equals(""))) {
			throw new NullIdException();
		}
		if (this.devices.containsKey(id)) {
			this.devices.remove(id);
		} else {
			throw new UnknownDeviceException();
		}
	}
712662
public URI attachmentUri(String documentId, String attachmentId) {
        String base_uri = String.format(
                "%s/%s/%s",
                this.rootUriString,
                this.encodeId(documentId),
                this.encodeId(attachmentId)
        );
        return uriFor(base_uri);
    }
429390
public <V> V detach(final AttachmentKey<V> key) {
        assert key != null;
        return key.cast(contextAttachments.remove(key));
    }
974409
def delete_attachment(self, attachment):
        

        # Get the holding parent of this attachment
        parent = None
        if attachment.getLinkedRequests():
            # Holding parent is an AR
            parent = attachment.getRequest()
        elif attachment.getLinkedAnalyses():
            # Holding parent is an Analysis
            parent = attachment.getAnalysis()

        if parent is None:
            logger.warn(
                "Attachment {} is nowhere assigned. This should never happen!"
                .format(repr(attachment)))
            return False

        # Get the other attachments of the holding parent
        attachments = parent.getAttachment()

        # New attachments to set
        if attachment in attachments:
            attachments.remove(attachment)

        # Set the attachments w/o the current attachments
        parent.setAttachment(attachments)

        retain = False

        # Attachment is referenced by another Analysis
        if attachment.getLinkedAnalyses():
            holder = attachment.getAnalysis()
            logger.info("Attachment {} referenced by {} -> RETAIN"
                        .format(repr(attachment), repr(holder)))
            retain = True

        # Attachment is referenced by another AR
        if attachment.getLinkedRequests():
            holder = attachment.getRequest()
            logger.info("Attachment {} referenced by {} -> RETAIN"
                        .format(repr(attachment), repr(holder)))
            retain = True

        # Delete attachment finally
        if retain is False:
            client = api.get_parent(attachment)
            client.manage_delObjects([attachment.getId(), ])
11633
public void remove(BeanId beanId)
    {
        final String fileName = getPortableFilename(beanId);
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "remove: key=" + beanId + ", file=" + fileName); //d248470

        try
        {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() // 126586
            {
                public Void run()
                                throws Exception
                {
                    File theFile = getStatefulBeanFile(fileName, true);
                    if (isTraceOn && tc.isDebugEnabled()) //d152600
                        Tr.debug(tc, "deleting file: " + theFile.getName() + ", path: " + theFile.getPath());

                    boolean deleted = theFile.delete(); //d152600

                    if (isTraceOn && tc.isDebugEnabled()) //d152600
                        Tr.debug(tc, "File.delete returned: " + deleted);
                    return null;
                }
            });
        } catch (PrivilegedActionException ex)
        {
            FFDCFilter.processException(ex.getException(), CLASS_NAME + ".remove", "150", this);
            if (isTraceOn && tc.isEventEnabled())
                Tr.event(tc, "Failed to remove session bean state", new Object[] { beanId, ex });
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "remove");
    }
801458
public Comment removeComment(final long commentId) {
        Comment removedComment = null;

        if (comments != null) {
            for (int index = comments.size() - 1; index >= 0; --index) {
                Comment currentComment = comments.get(index);

                if (currentComment.getId() == commentId) {
                    removedComment = comments.remove(index);
                    break;
                }
            }
        }

        return removedComment;
    }
348775
public int remove(CmsUUID id) {

        CmsDetailPageInfo info = m_infoById.get(id);
        if (info == null) {
            throw new IllegalArgumentException();
        }
        String type = info.getType();
        List<CmsDetailPageInfo> infos = m_map.get(type);
        int pos = infos.indexOf(info);
        infos.remove(pos);
        m_infoById.remove(id);
        return pos;

    }
553896
public ProxyPolicyHandler removeProxyPolicyHandler(String id) {
    return (id != null && this.proxyPolicyHandlers != null) ?
        (ProxyPolicyHandler)this.proxyPolicyHandlers.remove(id) :
        null;
    }
1062526
def deleteAttachment(self, oid, attachment_id):
        
        url = self._url + "/%s/deleteAttachments" % oid
        params = {
            "f":"json",
            "attachmentIds" : "%s" % attachment_id
        }
        return self._post(url, params,
                             securityHandler=self._securityHandler,
                             proxy_port=self._proxy_port,
                             proxy_url=self._proxy_url)
1236744
public void remove(String tenantId, String triggerId) {
        if (tenantId == null) {
            throw new IllegalArgumentException("tenantId must be not null");
        }
        if (triggerId == null) {
            throw new IllegalArgumentException("triggerId must be not null");
        }
        Set<DataEntry> dataEntriesToRemove = new HashSet<>();
        activeDataEntries.stream().forEach(e -> {
            if (e.getTenantId().equals(tenantId) && e.getTriggerId().equals(triggerId)) {
                dataEntriesToRemove.add(e);
            }
        });
        activeDataEntries.removeAll(dataEntriesToRemove);
        Set<DataId> dataIdToCheck = new HashSet<>();
        dataEntriesToRemove.stream().forEach(e -> {
            dataIdToCheck.add(new DataId(e.getTenantId(), e.getDataId()));
        });
        Set<DataId> dataIdToRemove = new HashSet<>();
        dataIdToCheck.stream().forEach(dataId -> {
            boolean found = false;
            for (DataEntry entry : activeDataEntries) {
                DataId currentDataId = new DataId(entry.getTenantId(), entry.getDataId());
                if (currentDataId.equals(dataId)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                dataIdToRemove.add(dataId);
            }
        });
        activeDataIds.removeAll(dataIdToRemove);
    }
692478
public MockVolume deleteVolume(final String volumeId) {

        if (volumeId != null && allMockVolumes.containsKey(volumeId)) {
            return  allMockVolumes.remove(volumeId);
        }

        return null;
    }
57665
public BoxRequestsFolder.DeleteTrashedFolder getDeleteTrashedFolderRequest(String id) {
        BoxRequestsFolder.DeleteTrashedFolder request = new BoxRequestsFolder.DeleteTrashedFolder(id, getTrashedFolderUrl(id), mSession);
        return request;
    }
1133921
private void removeClientId(String clientId) {
        //Sometimes the client Id will be null. For instance in the case QueueConnectionFactory, there is no default client Id specified in metatype.xml. 
        if (clientId == null)
            return; //do nothing

        ConcurrentHashMap<String, Integer> clientIdTable = JmsFactoryFactoryImpl.getClientIdTable();

        if (clientIdTable.containsKey(clientId)) {
            int referenceCount = clientIdTable.get(clientId).intValue();
            if (referenceCount == 1) {
                clientIdTable.remove(clientId);
            } else {
                clientIdTable.put(clientId, clientIdTable.get(clientId).intValue() - 1);
            }
        }
    }