Skip to content

Commit e181141

Browse files
committed
refactor BrokerReportFactory
1 parent 9a93e1a commit e181141

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/org/spacious_team/broker/report_parser/api/AbstractBrokerReportFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public abstract class AbstractBrokerReportFactory implements BrokerReportFactory
2929
/**
3030
* @param expectedFileNamePattern used for fast report check without input stream reading
3131
*/
32-
protected boolean canCreate(Pattern expectedFileNamePattern, String excelFileName, InputStream is) {
33-
return expectedFileNamePattern.matcher(excelFileName).matches();
32+
protected boolean canCreate(Pattern expectedFileNamePattern, String fileName, InputStream is) {
33+
return expectedFileNamePattern.matcher(fileName).matches();
3434
}
3535

3636
/**
@@ -40,7 +40,7 @@ protected boolean canCreate(Pattern expectedFileNamePattern, String excelFileNam
4040
* @return broker report if can parse or null
4141
* @throws IllegalArgumentException if InputStream is not supports mark
4242
*/
43-
protected BrokerReport create(String excelFileName,
43+
protected BrokerReport create(String fileName,
4444
InputStream is,
4545
BiFunction<String, InputStream, BrokerReport> brokerReportProvider) {
4646
if (!is.markSupported()) {
@@ -50,7 +50,7 @@ protected BrokerReport create(String excelFileName,
5050
is.mark(Integer.MAX_VALUE);
5151
Exception exception = null;
5252
try {
53-
return brokerReportProvider.apply(excelFileName, is);
53+
return brokerReportProvider.apply(fileName, is);
5454
} catch (Exception e) {
5555
exception = e;
5656
return null;

src/main/java/org/spacious_team/broker/report_parser/api/BrokerReportFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public interface BrokerReportFactory {
2828
* @return false when can't parse, true when parsing maybe possible
2929
* @throws IllegalArgumentException if InputStream is not supports mark
3030
*/
31-
boolean canCreate(String excelFileName, InputStream is);
31+
boolean canCreate(String fileName, InputStream is);
3232

3333
/**
3434
* Checks input stream and returns broker report if can, otherwise reset input stream mark to original position
3535
* and returns null
3636
* @return broker report if can parse or null
3737
* @throws IllegalArgumentException if InputStream is not supports mark
3838
*/
39-
BrokerReport create(String excelFileName, InputStream is);
39+
BrokerReport create(String fileName, InputStream is);
4040

4141
String getBrokerName();
4242
}

0 commit comments

Comments
 (0)