| Modifier and Type | Class and Description |
|---|---|
| private static record | LinkedFileHandler.
If exists: the path already exists and has the same content as the given sourcePath |
| Modifier and Type | Field and Description |
|---|---|
| private final BibDatabaseContext | |
| private final BibEntry | |
| private final FilePreferences | |
| private final LinkedFile | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | LinkedFileHandler(LinkedFile linkedFile, BibEntry entry, @NonNull BibDatabaseContext databaseContext, @NonNull FilePreferences filePreferences)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | copyOrMoveToDefaultDirectory(boolean shouldMove, boolean shouldRenameToFilenamePattern)
Returns: true if the file was copied/moved or the same file exists in the target directory |
| private boolean | copyOrMoveToExactDirectory(Path targetDirectory, boolean shouldMove, boolean shouldRenameToFilenamePattern)
|
| public Optional | Returns: First identified path that matches an existing file. This name can be used in subsequent calls to override the existing file.Check to see if a file already exists in the target directory. |
| public String | Returns: the suggested filename, including extensionDetermines the suggested file name based on the pattern specified in the preferences and valid for the file system. |
| public String | Returns: the suggested filename, including extensionThe extension of the file. extension)Determines the suggested file name based on the pattern specified in the preferences and valid for the file system. |
| private LinkedFileHandler. | |
| public boolean | |
| public void | |
| public boolean | |
| public boolean |
| databaseContext | back to summary |
|---|---|
| private final BibDatabaseContext databaseContext | |
| entry | back to summary |
|---|---|
| private final BibEntry entry | |
| filePreferences | back to summary |
|---|---|
| private final FilePreferences filePreferences | |
| linkedFile | back to summary |
|---|---|
| private final LinkedFile linkedFile | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| LinkedFileHandler | back to summary |
|---|---|
| public LinkedFileHandler(LinkedFile linkedFile, BibEntry entry, @NonNull BibDatabaseContext databaseContext, @NonNull FilePreferences filePreferences) | |
| copyOrMoveToDefaultDirectory | back to summary |
|---|---|
public boolean copyOrMoveToDefaultDirectory(boolean shouldMove, boolean shouldRenameToFilenamePattern) throws IOException
| |
| copyOrMoveToExactDirectory | back to summary |
|---|---|
| private boolean copyOrMoveToExactDirectory(Path targetDirectory, boolean shouldMove, boolean shouldRenameToFilenamePattern) throws IOException | |
| findExistingFile | back to summary |
|---|---|
| public Optional Check to see if a file already exists in the target directory. Search is not case sensitive. | |
| getSuggestedFileName | back to summary |
|---|---|
| public String getSuggestedFileName() Determines the suggested file name based on the pattern specified in the preferences and valid for the file system. Uses file extension from original file.
| |
| getSuggestedFileName | back to summary |
|---|---|
| public String getSuggestedFileName(@NonNull String extension) Determines the suggested file name based on the pattern specified in the preferences and valid for the file system. Uses the provided file extension. | |
| getTargetPath | back to summary |
|---|---|
| private LinkedFileHandler. | |
| moveToDefaultDirectory | back to summary |
|---|---|
| public boolean moveToDefaultDirectory() throws IOException | |
| moveToExactDirectory | back to summary |
|---|---|
| public void moveToExactDirectory(Path targetDirectory) throws IOException | |
| renameToName | back to summary |
|---|---|
| public boolean renameToName(String targetFileName, boolean overwriteExistingFile) throws IOException | |
| renameToSuggestedName | back to summary |
|---|---|
| public boolean renameToSuggestedName() throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final Path | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public boolean | |
| public final int | |
| public Path | |
| public boolean | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| exists | back to summary |
|---|---|
| private final boolean exists Record Component accessed by exists(). | |
| path | back to summary |
|---|---|
| private final Path path Record Component accessed by path(). | |
| renamed | back to summary |
|---|---|
| private final boolean renamed Record Component accessed by renamed(). The original/suggested filename was adapted to fit it | |
| GetTargetPathResult | back to summary |
|---|---|
| private GetTargetPathResult(boolean exists, boolean renamed, Path path) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| exists | back to summary |
|---|---|
| public boolean exists() Record Component getter of exists. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| path | back to summary |
|---|---|
| public Path path() Record Component getter of path. | |
| renamed | back to summary |
|---|---|
| public boolean renamed() Record Component getter of renamed.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |