add some logic for delete configurations file for the legacy command cache
@@ -34,6 +34,7 @@ import com.orientechnologies.orient.core.record.ORecord;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.query.OLegacyResultSet;
import com.orientechnologies.orient.core.storage.OStorage;
+import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage;
import com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage;
import java.io.File;
@@ -51,9 +52,9 @@ import java.util.Set;
*/
public class OCommandCacheSoftRefs implements OCommandCache {
- private String CONFIG_FILE = "command-cache.json";
+ private static String CONFIG_FILE = "command-cache.json";
- ODocument configuration;
+ private ODocument configuration;
public static class OCachedResult {
Object result;
@@ -432,4 +433,11 @@ public class OCommandCacheSoftRefs implements OCommandCache {
}
}
+ public static void clearFiles(OAbstractPaginatedStorage storage) {
+ String name = ((OLocalPaginatedStorage) storage).getStoragePath().resolve(CONFIG_FILE).toString();
+ File file = new File(name);
+ if (file.exists())
+ file.delete();
+ }
+
}
