19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.lang.ref.WeakReference;
32 class TranslationTask
implements Runnable {
34 private final WeakReference<AbstractAbstractFileNode<?>> weakNodeRef;
35 private final PropertyChangeListener listener;
37 public TranslationTask(WeakReference<AbstractAbstractFileNode<?>> weakContentRef, PropertyChangeListener listener) {
38 this.weakNodeRef = weakContentRef;
39 this.listener = listener;
44 AbstractAbstractFileNode<?> fileNode = weakNodeRef.get();
46 if (fileNode == null) {
50 String translatedFileName = fileNode.getTranslatedFileName();
51 if (!translatedFileName.isEmpty() && listener != null) {
53 listener.propertyChange(
new PropertyChangeEvent(
54 AutopsyEvent.SourceType.LOCAL.toString(),
55 AbstractAbstractFileNode.NodeSpecificEvents.TRANSLATION_AVAILABLE.toString(),
56 null, translatedFileName));