mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed FileNotFoundException in StudyDirectoryProjectGenerator
This commit is contained in:
+10
@@ -310,6 +310,13 @@ public class StudyDirectoryProjectGenerator extends PythonProjectGenerator imple
|
||||
File cashFile = new File(myCoursesDir, CACHE_NAME);
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
if (!cashFile.exists()) {
|
||||
final boolean created = cashFile.createNewFile();
|
||||
if (!created) {
|
||||
LOG.error("Cannot flush courses cache. Can't create " + CACHE_NAME + " file");
|
||||
return;
|
||||
}
|
||||
}
|
||||
writer = new PrintWriter(cashFile);
|
||||
for (Map.Entry<CourseInfo, File> course : myCourses.entrySet()) {
|
||||
CourseInfo courseInfo = course.getKey();
|
||||
@@ -322,6 +329,9 @@ public class StudyDirectoryProjectGenerator extends PythonProjectGenerator imple
|
||||
catch (FileNotFoundException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
finally {
|
||||
StudyUtils.closeSilently(writer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user