Package net.filebot.format
Class ExpressionFormatMethods
java.lang.Object
net.filebot.format.ExpressionFormatMethods
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Convert to acronym.static String
Match substring before the given pattern or return the original value.static File
static String
Convert Unicode characters to ASCII.static String
static String
asciiQuotes
(String self) static String
Match substring before the given pattern or return the original value.static StructuredFile
bitwiseNegate
(StructuredFile self) Nullify the Movies / TV Series folder level.static List
<?> static Object
Unwind if an object does not satisfy the given predicate.static String
Strip brackets and other clutter patterns.static String
Replace all colons.static String
static int
static StructuredFile
derive
(StructuredFile self, Object tag, Object... tags) Add values to the file name, after the file name, but before the subtitle language suffix and file extension.static StructuredFile
deriveFolder
(StructuredFile self, Object tag, Object... tags) Add a value to the movie / series folder name.static File
static File
static File
static File
static Matcher
Find match in case-insensitive mode.static Matcher
findWordMatch
(String self, String pattern) Find match in between word boundaries in case-insensitive mode.static String
format
(TemporalAmount self, String pattern) static String
format
(TemporalAmount self, String pattern, Locale locale) static String
static String
static String
static String
static long
getDiskSpace
(File self) getGraphemeClusters
(String self) static File
getRelativePathTail
(File self, int tailSize) static File
static File
static String
initialName
(String self) Reduce first name to initials.static boolean
static String
joining
(Collection<?> self, String delimiter) static String
joining
(Collection<?> self, String delimiter, String prefix, String suffix) static String
joiningDistinct
(Collection<?> self, String delimiter, Closure<?>... mapper) static String
joiningDistinct
(Collection<?> self, String delimiter, String prefix, String suffix, Closure<?>... mapper) static StructuredFile
leftShift
(StructuredFile self, Object tag) Add a value to the season folder level.static String
Convert all characters to lower case/ e.g.static String
static String
lowerTrail
(String self) Convert all trailing characters to lower case.static String
Match pattern and return or unwind if pattern cannot be found.static String
static Object
Find matching pattern and return mapped value.static Object
match
(Collection<?> self, Map<?, ?> matcher) Match all occurrences of the given pattern or unwind if pattern cannot be found.matchBrackets
(String self) Match brackets pattern.static File
static StructuredFile
mod
(StructuredFile self, Object tag) Add values to the file name, after the file name, but before the subtitle language suffix and file extension.static StructuredFile
multiply
(StructuredFile self, Object tag) Add a value to the movie / series folder name.static ReverseComparable
negative
(Comparable self) static String
pad
(CharSequence self, int length, CharSequence padding) static String
static String
Pad number patterns to length using the given character.static Date
static Date
static Date
static File
static String
static StructuredFile
power
(StructuredFile self, Object tag) Add a value to the file name and the movie / series folder name.static String
static String
static String
removeBrackets
(String self) Remove brackets pattern.static String
Strip characters that aren't allowed on Windows from the given filename.static String
Apply replacement mappings.static Collection
<String> replace
(Collection<?> self, Map<String, String> replacer) Apply replacement mappings.static String
replaceAll
(String self, String pattern) static String
Replace characters that aren't allowed on Windows from the given filename with similar-looking unicode equivalentsstatic String
replacePart
(String self) Strip trailing part number.static String
replacePart
(String self, String replacement) Replace trailing part number.static String
Strip trailing parenthesis.static String
replaceTrailingBrackets
(String self, String replacement) Replace trailing parenthesis.static StructuredFile
rightShift
(StructuredFile self, Object tag) Add a value to the A-Z folder level.static String
static String
Replace numbers 1..12 with Roman numerals.static Number
Round decimal number to precision.static String
Replace all slashes.static String
sortInitial
(String self) static String
Convert to sort name.static String
static String
Replace all spaces.static LocalDateTime
static LocalDateTime
static File
static File
static Locale
static String
transliterate
(String self, String transformIdentifier) Apply any ICU script transliteration.static String
static String
static String
Convert all characters to upper case.static String
static String
upperInitial
(String self) Convert all initial characters to upper case.static StructuredFile
xor
(StructuredFile self, Object tag) Replace subtitle language suffix.
-
Method Details
-
lower
Convert all characters to lower case/ e.g. "Firelfy" ➔ "firefly" -
lower
-
upper
Convert all characters to upper case. e.g. "Firelfy" ➔ "FIREFLY" -
upper
-
pad
Pad number patterns to length using the given character. e.g. "1x01" ➔ "01x001" -
pad
-
pad
-
round
Round decimal number to precision. e.g. "3.14" ➔ "3.1" -
match
Match pattern and return or unwind if pattern cannot be found. -
match
-
matchAll
Match all occurrences of the given pattern or unwind if pattern cannot be found. -
matchAll
-
replaceAll
-
removeAll
-
remove
-
removeIllegalCharacters
Strip characters that aren't allowed on Windows from the given filename. e.g. "Sissi: The Young Empress" ➔ "Sissi The Young Empress" -
replaceIllegalCharacters
Replace characters that aren't allowed on Windows from the given filename with similar-looking unicode equivalents -
clean
Strip brackets and other clutter patterns. e.g. [ONe]_Ano_Hana_01_(1280x720) ➔ Ano Hana 01 -
space
Replace all spaces. e.g. "Doctor Who" ➔ "Doctor_Who" -
colon
Replace all colons. e.g. "Sissi: The Young Empress" ➔ "Sissi - The Young Empress" -
colon
-
slash
Replace all slashes. e.g. "V_MPEG4/ISO/AVC" ➔ "V_MPEG4.ISO.AVC" -
upperInitial
Convert all initial characters to upper case. e.g. "The Day a new Demon was born" ➔ "The Day A New Demon Was Born" -
lowerTrail
Convert all trailing characters to lower case. e.g. "Gundam SEED" ➔ "Gundam Seed" -
sortName
Convert to sort name. e.g. "The Walking Dead" ➔ "Walking Dead" -
sortName
-
sortInitial
-
initialName
Reduce first name to initials. e.g. "James Cameron" ➔ "J. Cameron" -
truncate
-
truncate
-
before
Match substring before the given pattern or return the original value. -
after
Match substring before the given pattern or return the original value. -
findMatch
Find match in case-insensitive mode. -
findWordMatch
Find match in between word boundaries in case-insensitive mode. -
matchBrackets
Match brackets pattern. e.g. "The IT Crowd (UK)" ➔ "UK" -
removeBrackets
Remove brackets pattern. e.g. "The IT Crowd (UK)" ➔ "The IT Crowd" -
replaceTrailingBrackets
Strip trailing parenthesis. e.g. "The IT Crowd (UK)" ➔ "The IT Crowd" -
replaceTrailingBrackets
Replace trailing parenthesis. e.g. "The IT Crowd (UK)" ➔ "The IT Crowd [UK]" -
replacePart
Strip trailing part number. e.g. "Today Is the Day (1)" ➔ "Today Is the Day" -
replacePart
Replace trailing part number. e.g. "Today Is the Day (1)" ➔ "Today Is the Day, Part 1" -
acronym
Convert to acronym. e.g. "Deep Space 9" ➔ "DS9" -
roman
Replace numbers 1..12 with Roman numerals. e.g. "Star Wars: Episode 4" ➔ "Star Wars: Episode IV" -
roman
-
transliterate
Apply any ICU script transliteration. e.g. "中国" ➔ "zhōng guó" -
ascii
Convert Unicode characters to ASCII. e.g. "カタカナ" ➔ "katakana" -
ascii
-
asciiQuotes
-
isLatin
-
getGraphemeClusters
-
replace
Apply replacement mappings. e.g. replace(ä:'ae', ö:'oe', ü:'ue') -
replace
Apply replacement mappings. e.g. replace('Directors Cut':'DC') -
match
Find matching pattern and return mapped value. e.g. az.match('[a-f]': '/volume1', '[g-x]': '/volume2') ?: '/volume3' -
match
-
joining
-
joining
-
joiningDistinct
-
joiningDistinct
public static String joiningDistinct(Collection<?> self, String delimiter, String prefix, String suffix, Closure<?>... mapper) -
bounds
-
check
Unwind if an object does not satisfy the given predicate. e.g. (0..9)*.check{it invalid input: '<' 10}.sum() -
derive
Add values to the file name, after the file name, but before the subtitle language suffix and file extension. e.g. "Avatar (2009).mp4" ➔ "Avatar (2009) [720p].mp4" -
deriveFolder
Add a value to the movie / series folder name. e.g. Avatar (2009)/Avatar (2009) ➔ Avatar (2009) [TMDB-19995]/Avatar (2009) -
mod
Add values to the file name, after the file name, but before the subtitle language suffix and file extension. e.g. plex % {" by $director"} % {" [$vf, $vc, $ac]"} -
multiply
Add a value to the movie / series folder name. e.g. plex * " [TMDB-$id]" -
power
Add a value to the file name and the movie / series folder name. e.g. plex ** " [TMDB-$id]" -
bitwiseNegate
Nullify the Movies / TV Series folder level. e.g. ~plex -
leftShift
Add a value to the season folder level. e.g. plex invalid input: '<'invalid input: '<' { sy.bounds().joining('-', ' [', ']') } -
rightShift
Add a value to the A-Z folder level. e.g. plex >> { az } -
xor
Replace subtitle language suffix. e.g. plex ^ {'.'+lang.ISO2} -
ascii
-
getDiskSpace
-
getRoot
-
getTail
-
listPath
-
listPath
-
getRelativePathTail
-
toDate
-
toDate
-
toFile
-
toFile
-
toLocale
-
format
-
format
-
format
-
format
-
format
-
format
-
parseDate
-
parseDate
-
parseDate
-
compareTo
-
plus
-
div
-
div
-
div
-
div
-
mod
-
plus
-
negative
-