File tree Expand file tree Collapse file tree
modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -758,7 +758,10 @@ public void execute() throws MojoExecutionException {
758758
759759 if (storedInputSpecHashFile .getParent () != null && !new File (storedInputSpecHashFile .getParent ()).exists ()) {
760760 File parent = new File (storedInputSpecHashFile .getParent ());
761- parent .mkdirs ();
761+ if (!parent .mkdirs ()) {
762+ throw new RuntimeException ("Failed to create the folder " + parent .getAbsolutePath () +
763+ " to store the checksum of the input spec." );
764+ }
762765 }
763766 Files .asCharSink (storedInputSpecHashFile , StandardCharsets .UTF_8 ).write (inputSpecHash );
764767
@@ -790,7 +793,7 @@ private String calculateInputSpecHash(File inputSpecFile) throws IOException {
790793 File inputSpecTempFile = inputSpecFile ;
791794
792795 if (inputSpecRemoteUrl != null ) {
793- inputSpecTempFile = File . createTempFile ("openapi-spec" , ".tmp" );
796+ inputSpecTempFile = java . nio . file . Files . createTempFile ("openapi-spec" , ".tmp" ). toFile ( );
794797
795798 URLConnection conn = inputSpecRemoteUrl .openConnection ();
796799 if (isNotEmpty (auth )) {
You can’t perform that action at this time.
0 commit comments