File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
snaploader/src/main/java/electrostatic4j/snaploader/filesystem Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,10 @@ public void initialize(int size) throws IOException {
148148
149149 /**
150150 * Commands for the classpath routines.
151+ *
152+ * @throws FilesystemResourceInitializationException if the classpath routine fails to locate the file.
151153 */
152- protected void classPathRoutine () {
154+ protected void classPathRoutine () throws FilesystemResourceInitializationException {
153155 SnapLoaderLogger .log (Level .INFO , getClass ().getName (), "initialize(int)" ,
154156 "File locator initialized using classpath routine with hash key #" + getHashKey ());
155157 // Use the AppClassLoader, a BuiltinClassLoader to get the resources from the classpath
@@ -162,8 +164,9 @@ protected void classPathRoutine() {
162164 // getClassLoader() is invoked on them, it will return "null" pointer
163165 // indicating the invalidity of active loaders
164166 this .fileInputStream = getClass ().getClassLoader ().getResourceAsStream (filePath );
165- assert (this .fileInputStream != null ):
166- "Classpath Routine failed: the file is not in the classpath!" ;
167+ if (this .fileInputStream == null ) {
168+ throw new FilesystemResourceInitializationException ("Classpath Routine failed: the file is not in the classpath!" );
169+ }
167170 }
168171
169172 /**
You can’t perform that action at this time.
0 commit comments