Unbind Raw File

@param fileId       file id
@param isAutoCancel automatically cancel download
@param callback     file state callback
346187
@ObjectiveCName("unbindRawFileWithFileId:autoCancel:withCallback:")
    public void unbindRawFile(long fileId, boolean isAutoCancel, FileCallback callback) {
        modules.getFilesModule().unbindFile(fileId, callback, isAutoCancel);
    }
967721
@ObjectiveCName("bindRawUploadFileWithRid:withCallback:")
    public void bindRawUploadFile(long rid, UploadFileCallback callback) {
        modules.getFilesModule().bindUploadFile(rid, callback);
    }
303504
@Override
    public Promise<Void> unlink(String link) {
        return adapter.toPromise(handler -> vertx.fileSystem().unlink(link, handler));
    }
1129116
@Override
    @Transactional
    public void cancelSnapshot(String snapshotId) throws SnapshotException {
        checkInitialized();
        final Snapshot snapshot = getSnapshot(snapshotId);
        stop(snapshot);
        String snapshotDir = ContentDirUtils.getDestinationPath(snapshotId, this.config.getContentRootDir());
        deleteDirectory(snapshotDir);

        new Thread(new Runnable() {
            @Override
            public void run() {
                final DuracloudEndPointConfig source = snapshot.getSource();
                final String spaceId = source.getSpaceId();
                final ContentStore contentStore =
                    storeClientHelper.create(source,
                                             config.getDuracloudUsername(),
                                             config.getDuracloudPassword());
                try {
                    String result = new Retrier().execute(new Retriable() {
                        /* (non-Javadoc)
                         * @see org.duracloud.common.retry.Retriable#retry()
                         */
                        @Override
                        public Object retry() throws Exception {
                            CompleteCancelSnapshotTaskParameters params =
                                new CompleteCancelSnapshotTaskParameters();
                            params.setSpaceId(spaceId);
                            return contentStore.performTask(SnapshotConstants.COMPLETE_SNAPSHOT_CANCEL_TASK_NAME,
                                                            params.serialize());
                        }
                    });

                    log.info("snapshot cancellation is complete: {}", result);

                    snapshot.setStatus(SnapshotStatus.CANCELLED);
                    snapshot.setStatusText("");
                    eventLog.logSnapshotUpdate(snapshot);
                } catch (Exception ex) {
                    log.error("failed to complete cancellation on the durastore side for space {}:  {}",
                              spaceId,
                              ex.getMessage(),
                              ex);
                }

            }
        }).start();
    }
962222
public synchronized void removeBootstrapContext(String id)
   {
      if (id == null || id.trim().equals(""))
         throw new IllegalArgumentException("The id of BootstrapContext is invalid: " + id);

      Integer i = refCountBootstrapContexts.get(id);
      if (i != null)
      {
         int newValue = i.intValue() - 1;
         if (newValue == 0)
         {
            CloneableBootstrapContext cbc = activeBootstrapContexts.remove(id);
            refCountBootstrapContexts.remove(id);

            cbc.shutdown();

            workManagerCoordinator.removeWorkManager(id);
         }
         else
         {
            refCountBootstrapContexts.put(id, Integer.valueOf(newValue));
         }
      }
   }
435446
void unbind(String key)
    {
        NamedEntry entry = new NamedEntry(key, null, false);
        localUnbind(key);
        addForDeletion(entry);
    }
204218
public void unRegisterActivitDestroyedEvent(IActivityDestroyedCallback callback) {
        HMSAgentLog.d("unRegisterOnDestroyed:" + StrUtils.objDesc(callback));
        destroyedCallbacks.remove(callback);
    }
1134373
function(filePath, targetPath, callback) {
            client
                .moveFile(filePath, targetPath)
                .then(function() {
                    __executeCallbackAsync(callback, [null]);
                })
                .catch(callback);
        }
1098700
function(id, callback) {
        /**
         * Callback for QB.content.delete(id, callback)
         * @callback deleteFileCallback
         * @param {object} error - The error object
         * @param {object} response - Boolean
         */
        this.service.ajax({url: Utils.getUrl(config.urls.blobs, id), type: 'DELETE', dataType: 'text'}, function(err, result) {
            if (err) {
                callback(err, null);
            } else {
                callback(null, true);
            }
        });
    }
5443
@NonNull @UiThread
  public static Unbinder bind(@NonNull Activity target) {
    View sourceView = target.getWindow().getDecorView();
    return bind(target, sourceView);
  }
1274580
public void unbind(DataSource dataSource) throws NamingException {
        if (dataSource == null) {
            throw new IllegalArgumentException("dataSource cannot be null");
        }
        String jndiUrl = this.dataSourceBindings.get(dataSource);
        if (jndiUrl == null) {
            throw new NamingException("No such binding");
        }
        this.initialContext.unbind(jndiUrl);
        this.dataSourceBindings.remove(dataSource);
    }
1124153
public void cleanupAttachmentsForCall(Context context, UUID callId) {
        File dir = getAttachmentsDirectoryForCall(callId, false);
        Utility.deleteDirectory(dir);
    }
648362
public static void downloadAsync(String url, String file, HttpCallback<File> callback) {
        downloadAsync(url, file, null, callback, new StrParam[0]);
    }
778776
function(filename, callback) {
        fs.unlink(filename, function(err){
            if (err) {
                console.error(err.stack);
                callback(err)
            } else {
                callback(false)
            }
        })
    }
105775
function onBeforeUnloadIE () {
        nativeMethods.setTimeout.call(window, function () {
            //NOTE: except file downloading
            if (document.readyState === 'loading' &&
                !(document.activeElement && domUtils.isAnchorElement(document.activeElement) &&
                document.activeElement.hasAttribute('download')))
                onBeforeUnload();
        }, 0);
    }
605660
public synchronized void disableAutomaticReconnection() {
        if (!automaticReconnectEnabled) {
            return;
        }
        XMPPConnection connection = weakRefConnection.get();
        if (connection == null) {
            throw new IllegalStateException("Connection instance no longer available");
        }
        connection.removeConnectionListener(connectionListener);
        automaticReconnectEnabled = false;
    }
1195504
void cancel(AsyncChannelFuture future, Exception reason) throws ClosedChannelException, IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "cancel");
        }
        if (!isOpen()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Cancel request on closed connection");
            }
            future.setCancelInProgress(0);
            throw new ClosedChannelException();
        }

        // Cannot cancel a completed call.
        if (future.isCompleted()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Cancel request on completed future");
            }
            future.setCancelInProgress(0);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "cancel");
            }
            return;
        }

        long callid;
        if (((AsyncFuture) future).isRead()) {
            callid = this.readIOCB.getCallIdentifier();
        } else {
            callid = this.writeIOCB.getCallIdentifier();
        }

        int rc = provider.cancel2(this.channelIdentifier, callid);
        if (rc == 0) {
            // Mark the future completed with an Exception
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Cancel Successful, resetting CancelInProgress state to 0");
            }
            future.setCancelInProgress(0);
            future.completed(reason);
        } else {
            // could not cancel
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Cancel could not be completed");
            }
            future.setCancelInProgress(0);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "cancel");
        }
    }