| Modifier and Type | Field and Description |
|---|---|
| private static final int[] | ILLEGAL_CHARS
MUST ALWAYS BE A SORTED ARRAY because it is used in a binary search |
| public static final boolean | |
| private static final Logger | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Path | Returns: the with the modified file namethe path to add the extension to path, String the extension to add extension)Adds an extension to the given file name. |
| public static boolean | |
| public static String | Returns: a suggested dirNamethe database, where the entry is located database, BibEntry the entry to which the directory should be linked to entry, String the dirname pattern directoryNamePattern)Determines directory name provided by an entry in a database |
| public static String | Returns: a suggested fileNamethe database, where the entry is located database, BibEntry the entry to which the file should be linked to entry, String the filename pattern fileNamePattern)Determines filename provided by an entry in a database |
| public static boolean | Returns: Boolean whether there is an illegal name.the fileName to detect fileName)Detect illegal characters in given filename. |
| public static Optional | |
| public static Optional | |
| public static Optional | |
| public static List | Returns: a list including all found paths to files that match the defined conditionsthe name of the file that should be found filename, List<Path> the directories that will be searched directories)Finds a file inside a list of directory structures. |
| public static Optional | Returns: the path to the first file that matches the defined conditionsthe name of the file that should be found filename, Path the rootDirectory that will be searched rootDirectory)Finds a file inside a directory structure. |
| public static String | getBaseName(String fileNameWithExtension)
Returns the name part of a file name (i.e., everything in front of last "."). |
| public static String | getBaseName(Path fileNameWithExtension)
Returns the name part of a file name (i.e., everything in front of last "."). |
| public static Optional | Returns: the extension (without leading dot), trimmed and in lowercase.Returns the extension of a file name or Optional.empty() if the file does not have one (no "." in name). |
| public static Optional | Returns: the extension (without leading dot), trimmed and in lowercase.Returns the extension of a file or Optional.empty() if the file does not have one (no . |
| public static Path | Returns: Path of current panel database directory or the standard working directory in case the database was not saved yet
|
| public static List | Returns: list of files. May be emptylist of BibTeX entries bes, List<Path> list of directories to try for expansion fileDirs)Returns the list of linked files. |
| public static Optional | getUniquePathDirectory(List<String>
List of paths as Strings paths, Path The to be tested path comparePath)Looks for the unique directory, if any, different to the provided paths |
| public static Optional | getUniquePathFragment(List<String>
List of paths as Strings paths, Path The to be shortened path comparePath)Looks for the shortest unique path of the in a list of paths |
| public static String | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static Path | relativize(Path
the file to be shortened file, List<Path> directories to check directories)Converts an absolute file to a relative one, if possible. |
| public static Path | relativize(Path
the file path to be shortened path, BibDatabaseContext databaseContext, FilePreferences filePreferences)Converts an absolute file to a relative one, if possible. |
| public static String | toPortableString(Path path)
Creates a string representation of the given path that should work on all systems. |
| public static List | Returns: the minimal unique path substring for each file paththe file paths paths)Creates the minimal unique path substring for each file among multiple file paths. |
| ILLEGAL_CHARS | back to summary |
|---|---|
| private static final int[] ILLEGAL_CHARS MUST ALWAYS BE A SORTED ARRAY because it is used in a binary search | |
| IS_POSIX_COMPLIANT | back to summary |
|---|---|
| public static final boolean IS_POSIX_COMPLIANT | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| MAXIMUM_FILE_NAME_LENGTH | back to summary |
|---|---|
| public static final int MAXIMUM_FILE_NAME_LENGTH | |
| FileUtil | back to summary |
|---|---|
| private FileUtil() | |
| addExtension | back to summary |
|---|---|
| public static Path addExtension(Path path, String extension) Adds an extension to the given file name. The original extension is not replaced. That means, "demo.bib", ".sav" gets "demo.bib.sav" and not "demo.sav" Warning If "ext" is passed, this is literally added. Thus addExtension("tmp.txt", "ext") leads to "tmp.txtext" | |
| copyFile | back to summary |
|---|---|
| public static boolean copyFile(Path pathToSourceFile, Path pathToDestinationFile, boolean replaceExisting) Copies a file. | |
| createDirNameFromPattern | back to summary |
|---|---|
| public static String createDirNameFromPattern(BibDatabase database, BibEntry entry, String directoryNamePattern) Determines directory name provided by an entry in a database
| |
| createFileNameFromPattern | back to summary |
|---|---|
| public static String createFileNameFromPattern(BibDatabase database, BibEntry entry, String fileNamePattern) Determines filename provided by an entry in a database
| |
| detectBadFileName | back to summary |
|---|---|
| public static boolean detectBadFileName(String fileName) Detect illegal characters in given filename.
| |
| find | back to summary |
|---|---|
| public static Optional | |
| find | back to summary |
|---|---|
| public static Optional Converts a relative filename to an absolute one, if necessary. Returns an empty optional if the file does not exist. Will look in each of the given directories starting from the beginning and returning the first found file to match if any. | |
| find | back to summary |
|---|---|
| public static Optional Converts a relative filename to an absolute one, if necessary. | |
| findListOfFiles | back to summary |
|---|---|
| public static List Finds a file inside a list of directory structures. Will also look for the file inside nested directories. | |
| findSingleFileRecursively | back to summary |
|---|---|
| public static Optional Finds a file inside a directory structure. Will also look for the file inside nested directories. | |
| getBaseName | back to summary |
|---|---|
| public static String getBaseName(String fileNameWithExtension) Returns the name part of a file name (i.e., everything in front of last "."). | |
| getBaseName | back to summary |
|---|---|
| public static String getBaseName(Path fileNameWithExtension) Returns the name part of a file name (i.e., everything in front of last "."). | |
| getFileExtension | back to summary |
|---|---|
| public static Optional Returns the extension of a file name or Optional.empty() if the file does not have one (no "." in name). | |
| getFileExtension | back to summary |
|---|---|
| public static Optional Returns the extension of a file or Optional.empty() if the file does not have one (no . in name). | |
| getInitialDirectory | back to summary |
|---|---|
public static Path getInitialDirectory(BibDatabaseContext databaseContext, Path workingDirectory)
| |
| getListOfLinkedFiles | back to summary |
|---|---|
| public static List Returns the list of linked files. The files have the absolute filename | |
| getUniquePathDirectory | back to summary |
|---|---|
| public static Optional Looks for the unique directory, if any, different to the provided paths | |
| getUniquePathFragment | back to summary |
|---|---|
| public static Optional Looks for the shortest unique path of the in a list of paths | |
| getValidFileName | back to summary |
|---|---|
| public static String getValidFileName(String fileName) Returns a valid filename for most operating systems. Currently, only the length is restricted to 255 chars, see MAXIMUM_FILE_NAME_LENGTH.
For "real" cleaning, | |
| isBibFile | back to summary |
|---|---|
| public static boolean isBibFile(Path file) Test if the file is a bib file by simply checking the extension to be ".bib"
| |
| isCharLegal | back to summary |
|---|---|
| public static boolean isCharLegal(char c) | |
| isPDFFile | back to summary |
|---|---|
| public static boolean isPDFFile(Path file) Test if the file is a pdf file by simply checking the extension to be ".pdf"
| |
| relativize | back to summary |
|---|---|
| public static Path relativize(Path file, List<Path> directories) Converts an absolute file to a relative one, if possible. Returns the parameter file itself if no shortening is possible. This method works correctly only if directories are sorted decent in their length i.e. /home/user/literature/important before /home/user/literature. | |
| relativize | back to summary |
|---|---|
| public static Path relativize(Path path, BibDatabaseContext databaseContext, FilePreferences filePreferences) Converts an absolute file to a relative one, if possible. Returns the parameter file itself if no shortening is possible.
| |
| toPortableString | back to summary |
|---|---|
| public static String toPortableString(Path path) Creates a string representation of the given path that should work on all systems. This method should be used when a path needs to be stored in the bib file or preferences. | |
| uniquePathSubstrings | back to summary |
|---|---|
| public static List Creates the minimal unique path substring for each file among multiple file paths. | |