boolean isBackupFile;
- public BackupFilenameParts(File file, String base, String template, int digits)
+ public BackupFilenameParts(File file, String base, String template,
+ int digits)
{
this(file.getName(), base, template, digits);
}
numcharstart + BackupFiles.NUM_PLACEHOLDER.length());
digits = suggesteddigits;
}
-
+
// calculate minimum length of a backup filename
int minlength = base.length() + template.length()
- - BackupFiles.NUM_PLACEHOLDER.length() + digits ;
+ - BackupFiles.NUM_PLACEHOLDER.length() + digits;
if (!(filename.startsWith(base) && filename.length() >= minlength))
{
int startLength = base.length() + templateStart.length();
int endLength = templateEnd.length();
- String numString = numcharstart > -1?filename.substring(startLength,
- filename.length() - endLength):"";
+ String numString = numcharstart > -1
+ ? filename.substring(startLength, filename.length() - endLength)
+ : "";
if (filename.length() >= startLength + digits + endLength
&& filename.startsWith(base + templateStart)
{
this.base = base;
this.templateStart = templateStart;
- this.num = numString.length() > 0?Integer.parseInt(numString):0;
+ this.num = numString.length() > 0 ? Integer.parseInt(numString) : 0;
this.digits = digits;
this.templateEnd = templateEnd;
this.isBackupFile = true;
}
-
+
}
public boolean isBackupFile()