Skip to content

Commit 07a56a9

Browse files
authored
feat: update docs for invalid_input_files_in_subfolder (#1983)
* Updated docs for invalid_input_files_in_subfolder notice
1 parent 8987ead commit 07a56a9

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

core/src/main/java/org/mobilitydata/gtfsvalidator/input/GtfsInput.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public static GtfsInput createFromPath(Path path, NoticeContainer noticeContaine
6464
: new ZipFile(new SeekableInMemoryByteChannel(Files.readAllBytes(path)));
6565

6666
if (hasSubfolderWithGtfsFile(path)) {
67-
noticeContainer.addValidationNotice(
68-
new InvalidInputFilesInSubfolderNotice(invalidInputMessage));
67+
noticeContainer.addValidationNotice(new InvalidInputFilesInSubfolderNotice());
6968
}
7069
return new GtfsZipFileInput(zipFile, fileName);
7170
}
@@ -150,8 +149,7 @@ public static GtfsInput createFromUrlInMemory(
150149
String fileName = zipFile.getName().replace(".zip", "");
151150
if (containsGtfsFileInSubfolder(
152151
new ZipInputStream(new ByteArrayInputStream(outputStream.toByteArray())))) {
153-
noticeContainer.addValidationNotice(
154-
new InvalidInputFilesInSubfolderNotice(invalidInputMessage));
152+
noticeContainer.addValidationNotice(new InvalidInputFilesInSubfolderNotice());
155153
}
156154
return new GtfsZipFileInput(
157155
new ZipFile(new SeekableInMemoryByteChannel(outputStream.toByteArray())), fileName);

core/src/main/java/org/mobilitydata/gtfsvalidator/notice/InvalidInputFilesInSubfolderNotice.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
/**
88
* At least 1 GTFS file is in a subfolder.
99
*
10-
* <p>All GTFS files must reside at the root level directly.
10+
* <p>All GTFS files must reside at the root level directly. There are two common cases that trigger
11+
* this error:
12+
*
13+
* <pre>
14+
* 1. The root folder (e.g., a folder called "GTFS 2020") was zipped instead of the individual
15+
* files within the folder (e.g., `calendar.txt`, `agency.txt`, etc.). This can be fixed by
16+
* zipping the files directly instead.
17+
* 2. A file <a href="https://gtfs.org/documentation/schedule/reference/#dataset-files">associated
18+
* with GTFS</a> is in a subfolder rather than the root folder of the dataset, and needs to be
19+
* removed if not needed or moved to the root level.
20+
* </pre>
1121
*/
1222
@GtfsValidationNotice(severity = ERROR)
13-
public class InvalidInputFilesInSubfolderNotice extends ValidationNotice {
14-
/** The error message that explains the reason for the exception. */
15-
private final String message;
16-
17-
public InvalidInputFilesInSubfolderNotice(String message) {
18-
this.message = message;
19-
}
20-
}
23+
public class InvalidInputFilesInSubfolderNotice extends ValidationNotice {}

0 commit comments

Comments
 (0)