Revision 47607 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.sqlite/org.gvsig.sqlite.provider/src/main/java/org/gvsig/sqlite/dal/SQLiteExplorerFactory.java

View differences:

SQLiteExplorerFactory.java
1 1

  
2 2
package org.gvsig.sqlite.dal;
3 3

  
4
import java.io.File;
4 5
import org.gvsig.fmap.dal.DataServerExplorerParameters;
6
import org.gvsig.fmap.dal.PersonalDatabaseServerExplorerFactory;
5 7
import org.gvsig.fmap.dal.exception.InitializeException;
6 8
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
7 9
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters;
......
9 11
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
10 12
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
11 13
import org.gvsig.fmap.dal.store.jdbc2.impl.JDBCServerExplorerFactory;
14
import org.gvsig.sqlite.dal.geopackage.GeopackageUtils;
12 15

  
13 16

  
14
public class SQLiteExplorerFactory extends JDBCServerExplorerFactory {
17
public class SQLiteExplorerFactory 
18
        extends JDBCServerExplorerFactory 
19
        implements PersonalDatabaseServerExplorerFactory
20
    {
15 21

  
16 22
    private static final String NAME = SQLiteLibrary.NAME;
17 23
    
......
41 47
        JDBCServerExplorerParameters params = new SQLiteExplorerParameters();
42 48
        return params;    
43 49
    }
50

  
51
    @Override
52
    public String[] getPossibleExtensions(String extension) {
53
        return new String[] {
54
            GeopackageUtils.EXTENSION,
55
            GeopackageUtils.EXTENDED_EXTENSION,
56
            SQLiteUtils.EXTENSION_SQLITE,
57
            SQLiteUtils.EXTENSION_SQLITE3,
58
            SQLiteUtils.EXTENSION_DB,
59
            SQLiteUtils.EXTENSION_DB3,
60
            SQLiteUtils.EXTENSION_S3DB,
61
            SQLiteUtils.EXTENSION_SL3
62
        };
63
    }
64

  
65
    @Override
66
    public File[] getPossibleFiles(File dbfile) {
67
        return SQLiteUtils.getFiles(dbfile);
68
    }
69

  
70
    @Override
71
    public boolean existsdb(File dbfile) {
72
        return SQLiteUtils.existsdb(dbfile);
73
    }
74

  
75
    @Override
76
    public boolean removedb(File dbfile) {
77
        return SQLiteUtils.removedb(dbfile);
78
    }
79

  
80
    @Override
81
    public File normalizeFile(File dbfile) {
82
        String s = SQLiteUtils.removeFileNameExtension(dbfile.getPath());
83
        if( s == null ) {
84
            return null;
85
        }
86
        return new File(s+"."+GeopackageUtils.EXTENSION);
87
    }
88

  
89
    @Override
90
    public File removeExtension(File dbfile) {
91
        return new File(SQLiteUtils.removeFileNameExtension(dbfile.getPath()));
92
    }
93

  
94
    @Override
95
    public boolean isServerModeSupported() {
96
        return false;
97
    }
98

  
99
    @Override
100
    public void serverStop() {
101
        // Do nothing
102
    }
103

  
104
    @Override
105
    public void serverStart(Object... args) {
106
        // Do nothing
107
    }
108

  
109
    @Override
110
    public void serverSetEnabled(boolean enabled) {
111
        // Do nothing
112
    }
113

  
114
    @Override
115
    public boolean serverIsEnabled() {
116
        return false;
117
    }
118

  
119
    @Override
120
    public boolean serverIsStarted() {
121
        return false;
122
    }
44 123
    
45 124
}

Also available in: Unified diff