Skip to content

Commit 0578bbc

Browse files
Fixing some more code smells
1 parent e9ab824 commit 0578bbc

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/main/java/edu/ie3/datamodel/io/connectors/CsvFileConnector.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,8 @@ public BufferedReader initReader(Class<? extends UniqueEntity> clz)
180180
+ "'."));
181181
return initReader(filePath);
182182
} catch (ConnectorException e) {
183-
log.error(
184-
"Cannot get reader for entity '{}' as no file naming strategy for this file exists. Exception: {}",
185-
clz.getSimpleName(),
186-
e);
187-
throw e;
183+
throw new ConnectorException(
184+
"Cannot initialize reader for entity '" + clz.getSimpleName() + "'.", e);
188185
}
189186
}
190187

src/main/java/edu/ie3/datamodel/io/naming/FileNamingStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Optional<Path> getFilePath(T timeSeries) {
100100
* @return Concatenation of sub directory structure and file name
101101
* @deprecated replaced with {@link FileUtils#of(String, Optional)}
102102
*/
103-
@Deprecated
103+
@Deprecated(since = "3.0", forRemoval = true)
104104
private Optional<Path> getFilePath(String fileName, Optional<Path> subDirectories) {
105105
if (fileName.isEmpty()) return Optional.empty();
106106
return subDirectories

src/main/java/edu/ie3/datamodel/utils/FileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
/** Some utility functionalities. */
1818
public class FileUtils {
19-
public static final Pattern FILE_NAME_PATTERN =
19+
private static final Pattern FILE_NAME_PATTERN =
2020
Pattern.compile(
2121
"^(?<fileName>[^\\\\/\\s.]{0,255})(?:\\.(?<extension>[a-zA-Z0-9]{0,10}(?:\\.[a-zA-Z0-9]{0,10})?))?$");
22-
public static final String CSV_FILE_EXTENSION = "csv";
22+
private static final String CSV_FILE_EXTENSION = "csv";
2323

2424
private FileUtils() {
2525
throw new IllegalStateException("Utility classes cannot be instantiated");

0 commit comments

Comments
 (0)