1616 * 清理没有用过的图片
1717 */
1818class ImageCleaner implements Runnable {
19+
1920 private Thread t ;
2021
2122 EntryLib entrylib ;
@@ -35,7 +36,7 @@ class ImageCleaner implements Runnable {
3536 * 线程运行方法
3637 */
3738 public void run () {
38- File imageFolder = new File ("data/ EntryLib/images/" );
39+ File imageFolder = new File (EntryLib . IMAGES_FOLDER );
3940 if (imageFolder .exists ()) {
4041 List <File > tempList = Arrays .asList (imageFolder .listFiles ());
4142 List <File > imageFiles = new ArrayList (tempList );
@@ -113,7 +114,7 @@ public boolean exists(Statement stmt, String table) {
113114 boolean connect (String database ) {
114115 try {
115116 Class .forName ("org.sqlite.JDBC" );
116- c = DriverManager .getConnection ("jdbc:sqlite:data/EntryLib/databases/" + database );
117+ c = DriverManager .getConnection ("jdbc:sqlite:" + EntryLib . DATABASES_FOLDER + database );
117118
118119 stmt = c .createStatement ();
119120 if (!exists (stmt , "__MAIN_TABLE" )) return false ;
@@ -315,7 +316,7 @@ public List<File> Text2ImageFile(String text) {
315316 end = mt .end ();
316317
317318 String imageId = ImageParser .MiraiCode2Id (text .substring (start , end ));
318- File file = new File ("data/ EntryLib/images/" , imageId );
319+ File file = new File (EntryLib . IMAGES_FOLDER , imageId );
319320
320321 if (file .exists ())list .add (file );
321322 }
@@ -365,7 +366,7 @@ void listImage(String fileName) {
365366 */
366367 @ Override
367368 public void run () {
368- File file = new File ("data/ EntryLib/databases/" );
369+ File file = new File (EntryLib . DATABASES_FOLDER );
369370 if (!file .exists ()) return ;
370371
371372 File [] files = file .listFiles ();
0 commit comments