@Nullable
public ConnectionHandler getActiveConnection(VirtualFile virtualFile) {
// if the file is a database content file then get the connection from the underlying database object
if (VirtualFileUtil.isDatabaseFileSystem(virtualFile)) {
if (virtualFile instanceof DatabaseContentFile) {
DatabaseContentFile contentFile = (DatabaseContentFile) virtualFile;
return contentFile.getActiveConnection();
}
if (virtualFile instanceof DatabaseEditableObjectFile) {
DatabaseEditableObjectFile databaseFile = (DatabaseEditableObjectFile) virtualFile;
return databaseFile.getActiveConnection();
}