@@ -221,7 +221,7 @@ public Optional<IndividualTimeSeriesMetaInformation> getIndividualTimeSeriesMeta
221
221
}
222
222
223
223
/**
224
- * Receive the information for specific time series They are given back grouped by the column
224
+ * Receive the information for specific time series. They are given back grouped by the column
225
225
* scheme in order to allow for accounting the different content types.
226
226
*
227
227
* @param columnSchemes the column schemes to initialize readers for. If no scheme is given, all
@@ -244,6 +244,46 @@ public Optional<IndividualTimeSeriesMetaInformation> getIndividualTimeSeriesMeta
244
244
CsvIndividualTimeSeriesMetaInformation ::getColumnScheme , Collectors .toSet ()));
245
245
}
246
246
247
+ /**
248
+ * Removes the file ending from input string
249
+ *
250
+ * @param input String to manipulate
251
+ * @return input without possible ending
252
+ */
253
+ private String removeFileEnding (String input ) {
254
+ return input .replaceAll (FILE_ENDING + "$" , "" );
255
+ }
256
+
257
+ /**
258
+ * Returns a set of relative paths strings to time series files, with respect to the base folder
259
+ * path
260
+ *
261
+ * @return A set of relative paths to time series files, with respect to the base folder path
262
+ */
263
+ private Set <String > getIndividualTimeSeriesFilePaths () {
264
+ Path baseDirectoryPath =
265
+ Paths .get (
266
+ FilenameUtils .getFullPath (baseDirectoryName )
267
+ + FilenameUtils .getName (baseDirectoryName ));
268
+ try (Stream <Path > pathStream = Files .walk (baseDirectoryPath )) {
269
+ return pathStream
270
+ .map (baseDirectoryPath ::relativize )
271
+ .filter (
272
+ path -> {
273
+ String withoutEnding = removeFileEnding (path .toString ());
274
+ return entityPersistenceNamingStrategy
275
+ .getIndividualTimeSeriesPattern ()
276
+ .matcher (withoutEnding )
277
+ .matches ();
278
+ })
279
+ .map (Path ::toString )
280
+ .collect (Collectors .toSet ());
281
+ } catch (IOException e ) {
282
+ log .error ("Unable to determine time series files readers for time series." , e );
283
+ return Collections .emptySet ();
284
+ }
285
+ }
286
+
247
287
/**
248
288
* Compose the needed information for reading in a single time series. If the file points to a
249
289
* non-individual time series or a time series of a column scheme other than the specified ones,
@@ -305,46 +345,6 @@ public BufferedReader initIdCoordinateReader() throws FileNotFoundException {
305
345
return initReader (filePath );
306
346
}
307
347
308
- /**
309
- * Returns a set of relative paths strings to time series files, with respect to the base folder
310
- * path
311
- *
312
- * @return A set of relative paths to time series files, with respect to the base folder path
313
- */
314
- private Set <String > getIndividualTimeSeriesFilePaths () {
315
- Path baseDirectoryPath =
316
- Paths .get (
317
- FilenameUtils .getFullPath (baseDirectoryName )
318
- + FilenameUtils .getName (baseDirectoryName ));
319
- try (Stream <Path > pathStream = Files .walk (baseDirectoryPath )) {
320
- return pathStream
321
- .map (baseDirectoryPath ::relativize )
322
- .filter (
323
- path -> {
324
- String withoutEnding = removeFileEnding (path .toString ());
325
- return entityPersistenceNamingStrategy
326
- .getIndividualTimeSeriesPattern ()
327
- .matcher (withoutEnding )
328
- .matches ();
329
- })
330
- .map (Path ::toString )
331
- .collect (Collectors .toSet ());
332
- } catch (IOException e ) {
333
- log .error ("Unable to determine time series files readers for time series." , e );
334
- return Collections .emptySet ();
335
- }
336
- }
337
-
338
- /**
339
- * Removes the file ending from input string
340
- *
341
- * @param input String to manipulate
342
- * @return input without possible ending
343
- */
344
- private String removeFileEnding (String input ) {
345
- return input .replaceAll (FILE_ENDING + "$" , "" );
346
- }
347
-
348
348
/**
349
349
* Builds a new file definition consisting of file name and head line elements
350
350
*
0 commit comments