public interface IgnoreRule
IgnoreRule
specifies when to ignore a file.
If a file matches an IgnoreRule
, this file is not touched by CloudStore at all. It is neither
synchronised to a remote location nor is it deleted or otherwise treated.
There are 2 ways to declare an ignore-rule:
One is using a simple (shell-like) pattern on the name like "*.bak", for example. There are only the wild-cards '*' and '?' supported having the usual meaning:
namePattern
.
The other one is using a regular expression. If the property nameRegex
is specified,
the namePattern
is ignored.
Modifier and Type | Method and Description |
---|---|
String |
getIgnoreRuleId() |
String |
getNamePattern()
Gets a shell-style name-pattern or
null . |
String |
getNameRegex()
Gets a regular expression or
null . |
Pattern |
getNameRegexPattern()
|
boolean |
isCaseSensitive() |
boolean |
isEnabled() |
void |
setCaseSensitive(boolean caseSensitive) |
void |
setEnabled(boolean enabled) |
void |
setIgnoreRuleId(String ignoreRuleId) |
void |
setNamePattern(String namePattern) |
void |
setNameRegex(String nameRegex) |
String getIgnoreRuleId()
void setIgnoreRuleId(String ignoreRuleId)
String getNamePattern()
null
.
An ignore-rule may be specified using shell-patterns like "*.jpg" or "*.b?k". They are implicitly converted to regular expressions.
This name-pattern is checked against the file's name without path as returned by
File.getName()
(e.g. "image_938732.jpg").
If both, a regular expression and a shell-pattern are specified, the regular expression is used and this pattern ignored.
null
.getNameRegex()
void setNamePattern(String namePattern)
String getNameRegex()
null
.
This regular expression must match the entire file name (without path) - not only be contained in it. For example the regular expression "tree\.jpg" matches only the file "tree.jpg" and not the file "large_tree.jpg".
This name-regex is checked against the file's name without path as returned by
File.getName()
(e.g. "image_938732.jpg").
null
.getNamePattern()
void setNameRegex(String nameRegex)
boolean isEnabled()
void setEnabled(boolean enabled)
boolean isCaseSensitive()
void setCaseSensitive(boolean caseSensitive)
Pattern getNameRegexPattern()
Pattern
compiled from nameRegex
or namePattern
. If nameRegex
is specified, it overrules
namePattern
, i.e. namePattern
is used only, if nameRegex == null
.Pattern
compiled from nameRegex
or namePattern
. null
, if both nameRegex
and namePattern
are null
.Copyright © 2013–2019. All rights reserved.