File tree Expand file tree Collapse file tree
core/src/main/java/xyz/gianlu/librespot/cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import org .jetbrains .annotations .Nullable ;
55import xyz .gianlu .librespot .common .Utils ;
66
7- import java .io .*;
7+ import java .io .Closeable ;
8+ import java .io .File ;
9+ import java .io .IOException ;
10+ import java .io .RandomAccessFile ;
811import java .nio .charset .StandardCharsets ;
912import java .util .*;
1013
@@ -29,8 +32,11 @@ class CacheJournal implements Closeable {
2932 private final RandomAccessFile io ;
3033 private final Map <String , Entry > entries = Collections .synchronizedMap (new HashMap <>(1024 ));
3134
32- CacheJournal (@ NotNull File parent ) throws FileNotFoundException {
35+ CacheJournal (@ NotNull File parent ) throws IOException {
3336 File file = new File (parent , "journal.dat" );
37+ if (!file .exists () && !file .createNewFile ())
38+ throw new IOException ("Failed creating empty cache journal." );
39+
3440 io = new RandomAccessFile (file , "rwd" );
3541 }
3642
You can’t perform that action at this time.
0 commit comments