fix file delete
This commit is contained in:
@@ -62,7 +62,7 @@ public class FileUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static FileInputStream copyToTempFile(InputStream in, File temp) throws IOException {
|
public static FileInputStream copyToTempFile(InputStream in, File temp) throws IOException {
|
||||||
temp.deleteOnExit();
|
temp.delete();
|
||||||
try (OutputStream out = new FileOutputStream(temp)) {
|
try (OutputStream out = new FileOutputStream(temp)) {
|
||||||
byte[] buf = new byte[8192];
|
byte[] buf = new byte[8192];
|
||||||
int len;
|
int len;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class XfUtils {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
file.deleteOnExit();
|
file.delete();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException("语音听写异常:" + e.getMessage());
|
throw new BusinessException("语音听写异常:" + e.getMessage());
|
||||||
@@ -275,7 +275,7 @@ public class XfUtils {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
file.deleteOnExit();
|
file.delete();
|
||||||
}
|
}
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
throw new BusinessException("语音听写异常:" + e.getMessage());
|
throw new BusinessException("语音听写异常:" + e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user