Skip to content

Commit

Permalink
rename variable and method
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Dec 9, 2016
1 parent b47cebc commit 4526e5f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Expand Up @@ -48,7 +48,7 @@ public boolean isTriggeringEvent(File activeFile, final E event) {
if (time >= nextCheck) {
Date dateOfElapsedPeriod = dateInCurrentPeriod;
addInfo("Elapsed period: " + dateOfElapsedPeriod);
elapsedPeriodsFileName = tbrp.fileNamePatternWCS.convert(dateOfElapsedPeriod);
elapsedPeriodsFileName = tbrp.fileNamePatternWithoutCompSuffix.convert(dateOfElapsedPeriod);
setDateInCurrentPeriod(time);
computeNextCheck();
return true;
Expand Down
Expand Up @@ -123,7 +123,7 @@ public boolean isTriggeringEvent(File activeFile, final E event) {
// first check for roll-over based on time
if (time >= nextCheck) {
Date dateInElapsedPeriod = dateInCurrentPeriod;
elapsedPeriodsFileName = tbrp.fileNamePatternWCS.convertMultipleArguments(dateInElapsedPeriod, currentPeriodsCounter);
elapsedPeriodsFileName = tbrp.fileNamePatternWithoutCompSuffix.convertMultipleArguments(dateInElapsedPeriod, currentPeriodsCounter);
currentPeriodsCounter = 0;
setDateInCurrentPeriod(time);
computeNextCheck();
Expand All @@ -145,7 +145,7 @@ public boolean isTriggeringEvent(File activeFile, final E event) {
}
if (activeFile.length() >= maxFileSize.getSize()) {

elapsedPeriodsFileName = tbrp.fileNamePatternWCS.convertMultipleArguments(dateInCurrentPeriod, currentPeriodsCounter);
elapsedPeriodsFileName = tbrp.fileNamePatternWithoutCompSuffix.convertMultipleArguments(dateInCurrentPeriod, currentPeriodsCounter);
currentPeriodsCounter++;
return true;
}
Expand All @@ -155,7 +155,7 @@ public boolean isTriggeringEvent(File activeFile, final E event) {

@Override
public String getCurrentPeriodsFileNameWithoutCompressionSuffix() {
return tbrp.fileNamePatternWCS.convertMultipleArguments(dateInCurrentPeriod, currentPeriodsCounter);
return tbrp.fileNamePatternWithoutCompSuffix.convertMultipleArguments(dateInCurrentPeriod, currentPeriodsCounter);
}

public void setMaxFileSize(FileSize aMaxFileSize) {
Expand Down
Expand Up @@ -101,7 +101,7 @@ public String getElapsedPeriodsFileName() {
}

public String getCurrentPeriodsFileNameWithoutCompressionSuffix() {
return tbrp.fileNamePatternWCS.convert(dateInCurrentPeriod);
return tbrp.fileNamePatternWithoutCompSuffix.convert(dateInCurrentPeriod);
}

public void setCurrentTime(long timeInMillis) {
Expand Down
Expand Up @@ -44,7 +44,7 @@
public class TimeBasedRollingPolicy<E> extends RollingPolicyBase implements TriggeringPolicy<E> {
static final String FNP_NOT_SET = "The FileNamePattern option must be set before using TimeBasedRollingPolicy. ";
// WCS: without compression suffix
FileNamePattern fileNamePatternWCS;
FileNamePattern fileNamePatternWithoutCompSuffix;

private Compressor compressor;
private RenameUtil renameUtil = new RenameUtil();
Expand Down Expand Up @@ -78,9 +78,9 @@ public void start() {
compressor.setContext(context);

// wcs : without compression suffix
fileNamePatternWCS = new FileNamePattern(Compressor.computeFileNameStr_WCS(fileNamePatternStr, compressionMode), this.context);
fileNamePatternWithoutCompSuffix = new FileNamePattern(Compressor.computeFileNameStrWithoutCompSuffix(fileNamePatternStr, compressionMode), this.context);

addInfo("Will use the pattern " + fileNamePatternWCS + " for the active file");
addInfo("Will use the pattern " + fileNamePatternWithoutCompSuffix + " for the active file");

if (compressionMode == CompressionMode.ZIP) {
String zipEntryFileNamePatternStr = transformFileNamePattern2ZipEntry(fileNamePatternStr);
Expand Down
Expand Up @@ -159,7 +159,7 @@ ZipEntry computeZipEntry(File zippedFile) {
}

ZipEntry computeZipEntry(String filename) {
String nameOfFileNestedWithinArchive = computeFileNameStr_WCS(filename, compressionMode);
String nameOfFileNestedWithinArchive = computeFileNameStrWithoutCompSuffix(filename, compressionMode);
return new ZipEntry(nameOfFileNestedWithinArchive);
}

Expand Down Expand Up @@ -226,7 +226,7 @@ private void gzCompress(String nameOfFile2gz, String nameOfgzedFile) {
}
}

static public String computeFileNameStr_WCS(String fileNamePatternStr, CompressionMode compressionMode) {
static public String computeFileNameStrWithoutCompSuffix(String fileNamePatternStr, CompressionMode compressionMode) {
int len = fileNamePatternStr.length();
switch (compressionMode) {
case GZ:
Expand Down Expand Up @@ -278,6 +278,7 @@ public CompressionRunnable(String nameOfFile2Compress, String nameOfCompressedFi
}

public void run() {

Compressor.this.compress(nameOfFile2Compress, nameOfCompressedFile, innerEntryName);
}
}
Expand Down

0 comments on commit 4526e5f

Please sign in to comment.