java.lang.Object
org.apache.jena.rdfpatch.filelog.rotate.FileMgr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathfreshFilename(Path directory, String filename) static PathfreshFilename(Path directory, String filename, int startingFrom, String sep, String format) Find a unique file name, assumes that it will not take too many probes.static FilenameCreate aFilenameFind files matching a pattern.scanForIncrement(Path directory, String filename) Look for matching files of the "incremental" pattern: "filename.nnn".scanIncludeBase(Path directory, String filename, Pattern pattern) Find files matching a pattern and also include the base filename.static voidshiftFiles(Path directory, String filename) Shift files with a ".NNN" up by one, and move the base file to "filename.1".static voidshiftFiles(Path directory, String filename, int increment, String format)
-
Constructor Details
-
FileMgr
public FileMgr()
-
-
Method Details
-
freshFilename
-
freshFilename
public static Path freshFilename(Path directory, String filename, int startingFrom, String sep, String format) Find a unique file name, assumes that it will not take too many probes. Conceptually, ".0" is the base filename. This function does not create the file. Returns the full file name, directory included.- Parameters:
directory- Directory to look infilename- Base file name, without index modiferstartingFrom- Begin probing at indexformat- String format of the number as modifier e.g. "%03d"
-
scan
Find files matching a pattern. The pattern has groups:- 1 : the base filename.
- 2 : the separator
- 3 : the policy modifier.
- Parameters:
directory- Pathnamebase- base name of interestpattern- Regex to extract the part of the filename for aFilename- Returns:
- Unsorted List<Filename> of matches.
-
scanIncludeBase
Find files matching a pattern and also include the base filename. -
fromPath
Create aFilename -
shiftFiles
Shift files with a ".NNN" up by one, and move the base file to "filename.1".- Parameters:
directory-filename-
-
scanForIncrement
Look for matching files of the "incremental" pattern: "filename.nnn". This includes the filename itself, if it exists. -
shiftFiles
- Parameters:
directory-filename-increment-format-
-