1818import org .slf4j .Logger ;
1919import org .slf4j .LoggerFactory ;
2020
21- import com ._4point .aem .aem_utils .aem_cntrl .domain .AemProcess .AemProcessException ;
2221import com ._4point .aem .aem_utils .aem_cntrl .domain .ports .ipi .ProcessRunner ;
2322import com ._4point .aem .aem_utils .aem_cntrl .domain .ports .ipi .ProcessRunner .ListResult ;
2423import com ._4point .aem .aem_utils .aem_cntrl .domain .ports .ipi .ProcessRunner .ProcessRunnerException ;
@@ -56,7 +55,7 @@ private String getJavaEnv(Path aemQuickstartJarDir) {
5655 ListResult result = processRunner .runtoListResult (OperatingSystem .getOs ().jbangCommand ("jdk" , "java-env" , aemJavaVersion .getVersionString ()), aemQuickstartJarDir ).get ();
5756 return result .stdout ().stream ().collect (Collectors .joining ("\n " ));
5857 } catch (ProcessRunnerException | InterruptedException | ExecutionException e ) {
59- throw new AemProcessException (e );
58+ throw new ShimFilesException (e );
6059 }
6160 }
6261
@@ -72,7 +71,7 @@ public ShimFiles createBatFiles(CreateType createType) {
7271 writeScript (stopScriptPath , javaEnv + "\n " + aemQuickstartJarDir .resolve (AemFiles .STOP_SCRIPT ).toString ());
7372 return this ;
7473 } catch (IOException | UnsupportedOperationException e ) {
75- throw new AemProcessException ("Error while writing start/stop bat files to %s." .formatted (aemQuickstartJarDir ), e );
74+ throw new ShimFilesException ("Error while writing start/stop bat files to %s." .formatted (aemQuickstartJarDir ), e );
7675 }
7776 }
7877
@@ -116,4 +115,24 @@ public CompletableFuture<ListResult> stopAem() throws InterruptedException, Exec
116115 log .atInfo ().log ("Stopping AEM" );
117116 return processRunner .runtoListResult (new String [] {aemQuickstartJarDir .resolve (RUN_STOP ).toString ()}, aemQuickstartJarDir );
118117 }
118+
119+ @ SuppressWarnings ("serial" )
120+ public static class ShimFilesException extends RuntimeException {
121+
122+ public ShimFilesException () {
123+ super ();
124+ }
125+
126+ public ShimFilesException (String message , Throwable cause ) {
127+ super (message , cause );
128+ }
129+
130+ public ShimFilesException (String message ) {
131+ super (message );
132+ }
133+
134+ public ShimFilesException (Throwable cause ) {
135+ super (cause );
136+ }
137+ }
119138}
0 commit comments