Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
TaskCancellable.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2019-2019 Basis Technology Corp. Contact: carrier <at> sleuthkit
5 * <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8 * use this file except in compliance with the License. You may obtain a copy of
9 * the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations under
17 * the License.
18 */
19package org.sleuthkit.autopsy.progress;
20
21import java.util.concurrent.Future;
22import org.openide.util.Cancellable;
23import org.openide.util.NbBundle;
24
32public class TaskCancellable implements Cancellable {
33
35 private Future<?> future;
36
47 this.progress = progress;
48 }
49
55 public synchronized void setFuture(Future<?> future) {
56 this.future = future;
57 }
58
59 @Override
60 @NbBundle.Messages({
61 "TaskCanceller.progress.cancellingMessage=Cancelling..."
62 })
63 public synchronized boolean cancel() {
64 progress.setCancelling(Bundle.TaskCanceller_progress_cancellingMessage());
65 return future.cancel(true);
66 }
67
68}
synchronized void setFuture(Future<?> future)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.