Top Fields Constructors Methods
org.jabref.gui.copyfiles

public Class CopyFilesTask

extends Task<List<CopyFilesResultItemViewModel>>
Class Inheritance
Imports
java.io.BufferedWriter, .IOException, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.time.LocalDateTime, java.time.format.DateTimeFormatter, java.util.ArrayList, .List, .Optional, java.util.function.BiFunction, javafx.concurrent.Task, org.jabref.logic.l10n.Localization, org.jabref.logic.util.OS, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.util.OptionalUtil, org.jabref.preferences.PreferencesService, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private final List<BibEntry>
private final Path
private final String
private final String
private static final String
private static final String
private static final Logger
private Optional<Path>
private int
private final PreferencesService
private final BiFunction<Path, Path, Path>
private final List<CopyFilesResultItemViewModel>
private final long
private int

Constructor Summary

AccessConstructor and Description
public
CopyFilesTask(BibDatabaseContext databaseContext, List<BibEntry> entries, Path path, PreferencesService preferencesService)

Method Summary

Modifier and TypeMethod and Description
private void
addResultToList(Path newFile, boolean success, String logMessage)

protected List<CopyFilesResultItemViewModel>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

private void
writeLogMessage(Path newFile, BufferedWriter bw, String logMessage)

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
entriesback to summary
private final List<BibEntry> entries
exportPathback to summary
private final Path exportPath
localizedErrorMessageback to summary
private final String localizedErrorMessage
localizedSuccessMessageback to summary
private final String localizedSuccessMessage
LOGFILE_EXTback to summary
private static final String LOGFILE_EXT
LOGFILE_PREFIXback to summary
private static final String LOGFILE_PREFIX
LOGGERback to summary
private static final Logger LOGGER
newPathback to summary
private Optional<Path> newPath
numberSuccessfulback to summary
private int numberSuccessful
preferencesServiceback to summary
private final PreferencesService preferencesService
resolvePathFilenameback to summary
private final BiFunction<Path, Path, Path> resolvePathFilename
resultsback to summary
private final List<CopyFilesResultItemViewModel> results
totalFilesCountback to summary
private final long totalFilesCount
totalFilesCounterback to summary
private int totalFilesCounter

Constructor Detail

CopyFilesTaskback to summary
public CopyFilesTask(BibDatabaseContext databaseContext, List<BibEntry> entries, Path path, PreferencesService preferencesService)

Method Detail

addResultToListback to summary
private void addResultToList(Path newFile, boolean success, String logMessage)
callback to summary
protected List<CopyFilesResultItemViewModel> call() throws InterruptedException, IOException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Returns:List<CopyFilesResultItemViewModel>

The result of the background work, if any.

Annotations
@Override
writeLogMessageback to summary
private void writeLogMessage(Path newFile, BufferedWriter bw, String logMessage)