File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/java/com/nmerrill/kothcomm/communication Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 14
14
import java .io .*;
15
15
import java .net .MalformedURLException ;
16
16
import java .net .URL ;
17
+ import java .nio .file .Files ;
17
18
import java .util .List ;
18
19
import java .util .zip .GZIPInputStream ;
19
20
@@ -98,7 +99,12 @@ private void writeFile(File file, String contents){
98
99
}
99
100
100
101
private void saveOther (String codeBlock , File directory ){
101
-
102
+ try {
103
+ Files .createDirectories (directory .toPath ());
104
+ } catch (IOException e ){
105
+ System .out .println ("Unable to create directory " +directory .getAbsolutePath ());
106
+ return ;
107
+ }
102
108
int lineIndex = codeBlock .indexOf ('\n' );
103
109
String fileName = codeBlock .substring (0 , lineIndex ).trim ();
104
110
if (!fileName .contains ("." ) || fileName .contains (" " )){
You can’t perform that action at this time.
0 commit comments