|
@@ -193,11 +193,15 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
|
if (image.exists()) {
|
|
|
continue;
|
|
|
}
|
|
|
+ if (!image.getParentFile().exists()) {
|
|
|
+ image.getParentFile().mkdirs();
|
|
|
+ }
|
|
|
byte[] bs = Arrays.copyOf(ims.getImage(), ims.getImage().length);
|
|
|
out = new FileOutputStream(image);
|
|
|
out.write(bs, 0, bs.length);
|
|
|
out.flush();
|
|
|
} catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
} finally {
|
|
|
concurrentService.getReadWriteLock(path).writeLock().unlock();
|
|
|
if (out != null) {
|
|
@@ -219,6 +223,10 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
|
File image = new File(sysProperty.getDataDir() + "/" + path);
|
|
|
if (image.exists()) {
|
|
|
image.delete();
|
|
|
+ } else {
|
|
|
+ if (!image.getParentFile().exists()) {
|
|
|
+ image.getParentFile().mkdirs();
|
|
|
+ }
|
|
|
}
|
|
|
FileOutputStream out = null;
|
|
|
try {
|
|
@@ -227,6 +235,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
|
out.write(bs, 0, bs.length);
|
|
|
out.flush();
|
|
|
} catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
} finally {
|
|
|
if (out != null) {
|
|
|
try {
|