Statistics
| Revision:

gvsig-raster / org.gvsig.raster.multifile / branches / org.gvsig.raster.multifile_dataaccess_refactoring / org.gvsig.raster.multifile.io / src / main / java / org / gvsig / raster / multifile / io / MultiFileServerExplorer.java @ 2321

History | View | Annotate | Download (4.91 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
* MA  02110-1301, USA.
20
*
21
*/
22

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 IVER T.I   {{Task}}
26
*/
27

    
28
package org.gvsig.raster.multifile.io;
29

    
30
import java.io.File;
31
import java.util.List;
32

    
33
import org.gvsig.fmap.dal.DALLocator;
34
import org.gvsig.fmap.dal.DataManager;
35
import org.gvsig.fmap.dal.DataServerExplorer;
36
import org.gvsig.fmap.dal.DataServerExplorerParameters;
37
import org.gvsig.fmap.dal.DataStoreParameters;
38
import org.gvsig.fmap.dal.NewDataStoreParameters;
39
import org.gvsig.fmap.dal.coverage.RasterLocator;
40
import org.gvsig.fmap.dal.exception.CreateException;
41
import org.gvsig.fmap.dal.exception.DataException;
42
import org.gvsig.fmap.dal.exception.InitializeException;
43
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
44
import org.gvsig.fmap.dal.exception.RemoveException;
45
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
46
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
47
import org.gvsig.fmap.dal.spi.DataServerExplorerProvider;
48
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
49
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
50

    
51
/**
52
 * Explorer for a Multifile 
53
 * @author Nacho Brodin (nachobrodin@gmail.com)
54
 */
55
public class MultiFileServerExplorer extends AbstractFilesystemServerExplorerProvider implements DataServerExplorerProvider  {
56
        
57
        public MultiFileServerExplorer() {
58
                
59
        }
60
        
61
        public MultiFileServerExplorer(
62
                        MultiFileServerExplorerParameters parameters,
63
                        DataServerExplorerProviderServices services)
64
                        throws InitializeException {
65
                System.out.println();
66
        }
67
        
68
        public String getDataStoreProviderName() {
69
                return MultiFileProvider.NAME;
70
        }
71
        
72
        public String getDescription() {
73
                return MultiFileProvider.DESCRIPTION;
74
        }
75
        
76
        public DataStoreParameters getStoreParameters() {
77
                DataManager manager = DALLocator.getDataManager();
78
                try {
79
                        return  manager.createStoreParameters(this.getDataStoreProviderName());
80
                } catch (InitializeException e) {
81
                        e.printStackTrace();
82
                } catch (ProviderNotRegisteredException e) {
83
                        e.printStackTrace();
84
                }
85
                return null;
86
        }
87

    
88
        public List<?> getDataStoreProviderNames() {
89
                return null;
90
        }
91

    
92
        public String getProviderName() {
93
                return MultiFileProvider.NAME;
94
        }
95

    
96
        public DataServerExplorerProviderServices getServerExplorerProviderServices() {
97
                return null;
98
        }
99

    
100
        public boolean canCreate() {
101
                return false;
102
        }
103

    
104
        public boolean canCreate(NewDataStoreParameters parameters) {
105
                return false;
106
        }
107

    
108
        public void create(NewDataStoreParameters parameters, boolean overwrite)
109
                        throws CreateException {
110
                throw new UnsupportedOperationException();
111
        }
112

    
113
        public NewDataStoreParameters getCreateParameters() throws DataException {
114
                return null;
115
        }
116

    
117
        public void initialize(
118
                        FilesystemServerExplorerProviderServices serverExplorer) {
119
        }
120

    
121
        public boolean accept(File pathname) {
122
                return RasterLocator.getManager().getProviderServices().isExtensionSupported(
123
                                pathname.getAbsolutePath(), 
124
                                MultiFileProvider.class);
125
        }
126

    
127
        public void remove(DataStoreParameters parameters) throws RemoveException {
128
                throw new UnsupportedOperationException();
129
        }
130

    
131
        public boolean add(String provider, NewDataStoreParameters parameters,
132
                        boolean overwrite) throws DataException {
133
                return false;
134
        }
135

    
136
        public boolean canAdd() {
137
                return false;
138
        }
139

    
140
        public boolean canAdd(String storeName) throws DataException {
141
                return false;
142
        }
143

    
144
        public NewDataStoreParameters getAddParameters(String storeName)
145
                        throws DataException {
146
                return null;
147
        }
148
        
149
        public DataStoreParameters getParameters(File file) throws DataException {
150
                DataManager manager = DALLocator.getDataManager();
151
                AbstractRasterFileDataParameters params = (AbstractRasterFileDataParameters) manager
152
                                .createStoreParameters(this.getDataStoreProviderName());
153
                params.setFile(file);
154
                return params;
155
        }
156

    
157
        public DataServerExplorerParameters getParameters() {
158
                return null;
159
        }
160

    
161
        public List<?> list() throws DataException {
162
                return null;
163
        }
164

    
165
        public List<?> list(int mode) throws DataException {
166
                return null;
167
        }
168

    
169
        public void dispose() {
170
        }
171
        
172
        public int getMode() {
173
                return DataServerExplorer.MODE_RASTER;
174
        }
175

    
176
}