Top Fields Constructors Methods
org.jabref.logic.externalfiles

public Class LinkedFileHandler

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, .StandardCopyOption, java.util.Objects, .Optional, java.util.stream.Stream, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.preferences.FilePreferences, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private final BibEntry
private final LinkedFile
private final FilePreferences
private static final Logger

Constructor Summary

AccessConstructor and Description
public
LinkedFileHandler(LinkedFile fileEntry, BibEntry entry, BibDatabaseContext databaseContext, FilePreferences filePreferences)

Method Summary

Modifier and TypeMethod and Description
public Optional<Path>

Returns:

First identified path that matches an existing file. This name can be used in subsequent calls to override the existing file.
findExistingFile
(LinkedFile linkedFile, BibEntry entry, String targetFileName)

Check to see if a file already exists in the target directory.

public String
public String
public boolean
public boolean
renameToName(String targetFileName, boolean overwriteExistingFile)

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
entryback to summary
private final BibEntry entry
fileEntryback to summary
private final LinkedFile fileEntry
filePreferencesback to summary
private final FilePreferences filePreferences
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

LinkedFileHandlerback to summary
public LinkedFileHandler(LinkedFile fileEntry, BibEntry entry, BibDatabaseContext databaseContext, FilePreferences filePreferences)

Method Detail

findExistingFileback to summary
public Optional<Path> findExistingFile(LinkedFile linkedFile, BibEntry entry, String targetFileName)

Check to see if a file already exists in the target directory. Search is not case sensitive.

Returns:Optional<Path>

First identified path that matches an existing file. This name can be used in subsequent calls to override the existing file.

getSuggestedFileNameback to summary
public String getSuggestedFileName()
getSuggestedFileNameback to summary
public String getSuggestedFileName(String extension)
moveToDefaultDirectoryback to summary
public boolean moveToDefaultDirectory() throws IOException
renameToNameback to summary
public boolean renameToName(String targetFileName, boolean overwriteExistingFile) throws IOException
renameToSuggestedNameback to summary
public boolean renameToSuggestedName() throws IOException