Statistics
| Revision:

gvsig-raster / org.gvsig.raster.multifile / trunk / org.gvsig.raster.multifile / org.gvsig.raster.multifile.io / src / main / java / org / gvsig / raster / multifile / io / MultiFileServerExplorer.java @ 1874

History | View | Annotate | Download (6.53 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
        /*
69
         * (non-Javadoc)
70
         * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDataStoreProviderName()
71
         */
72
        public String getDataStoreProviderName() {
73
                return MultiFileProvider.NAME;
74
        }
75
        
76
        /*
77
         * (non-Javadoc)
78
         * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDescription()
79
         */
80
        public String getDescription() {
81
                return MultiFileProvider.DESCRIPTION;
82
        }
83
        
84
        /*
85
         * (non-Javadoc)
86
         * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getStoreParameters()
87
         */
88
        public DataStoreParameters getStoreParameters() {
89
                DataManager manager = DALLocator.getDataManager();
90
                try {
91
                        return  manager.createStoreParameters(this.getDataStoreProviderName());
92
                } catch (InitializeException e) {
93
                        e.printStackTrace();
94
                } catch (ProviderNotRegisteredException e) {
95
                        e.printStackTrace();
96
                }
97
                return null;
98
        }
99

    
100
        @SuppressWarnings("unchecked")
101
        public List getDataStoreProviderNames() {
102
                return null;
103
        }
104

    
105
        public String getProviderName() {
106
                return MultiFileProvider.NAME;
107
        }
108

    
109
        /*
110
         * (non-Javadoc)
111
         * @see org.gvsig.fmap.dal.spi.DataServerExplorerProvider#getServerExplorerProviderServices()
112
         */
113
        public DataServerExplorerProviderServices getServerExplorerProviderServices() {
114
                return null;
115
        }
116

    
117
        /*
118
         * (non-Javadoc)
119
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate()
120
         */
121
        public boolean canCreate() {
122
                return false;
123
        }
124

    
125
        /*
126
         * (non-Javadoc)
127
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate(org.gvsig.fmap.dal.NewDataStoreParameters)
128
         */
129
        public boolean canCreate(NewDataStoreParameters parameters) {
130
                return false;
131
        }
132

    
133
        /*
134
         * (non-Javadoc)
135
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#create(org.gvsig.fmap.dal.NewDataStoreParameters, boolean)
136
         */
137
        public void create(NewDataStoreParameters parameters, boolean overwrite)
138
                        throws CreateException {
139
                throw new UnsupportedOperationException();
140
        }
141

    
142
        /*
143
         * (non-Javadoc)
144
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#getCreateParameters()
145
         */
146
        public NewDataStoreParameters getCreateParameters() throws DataException {
147
                return null;
148
        }
149

    
150
        /*
151
         * (non-Javadoc)
152
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#initialize(org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices)
153
         */
154
        public void initialize(
155
                        FilesystemServerExplorerProviderServices serverExplorer) {
156
        }
157

    
158
        /*
159
         * (non-Javadoc)
160
         * @see java.io.FileFilter#accept(java.io.File)
161
         */
162
        public boolean accept(File pathname) {
163
                return RasterLocator.getManager().getProviderServices().isExtensionSupported(
164
                                pathname.getAbsolutePath(), 
165
                                MultiFileProvider.class);
166
        }
167

    
168
        /*
169
         * (non-Javadoc)
170
         * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#remove(org.gvsig.fmap.dal.DataStoreParameters)
171
         */
172
        public void remove(DataStoreParameters parameters) throws RemoveException {
173
                throw new UnsupportedOperationException();
174
        }
175

    
176
        public boolean add(String provider, NewDataStoreParameters parameters,
177
                        boolean overwrite) throws DataException {
178
                return false;
179
        }
180

    
181
        public boolean canAdd() {
182
                return false;
183
        }
184

    
185
        public boolean canAdd(String storeName) throws DataException {
186
                return false;
187
        }
188

    
189
        public NewDataStoreParameters getAddParameters(String storeName)
190
                        throws DataException {
191
                return null;
192
        }
193
        
194
        public DataStoreParameters getParameters(File file) throws DataException {
195
                DataManager manager = DALLocator.getDataManager();
196
                AbstractRasterFileDataParameters params = (AbstractRasterFileDataParameters) manager
197
                                .createStoreParameters(this.getDataStoreProviderName());
198
                params.setFile(file);
199
                return params;
200
        }
201

    
202
        public DataServerExplorerParameters getParameters() {
203
                return null;
204
        }
205

    
206
        @SuppressWarnings("unchecked")
207
        public List list() throws DataException {
208
                return null;
209
        }
210

    
211
        @SuppressWarnings("unchecked")
212
        public List list(int mode) throws DataException {
213
                return null;
214
        }
215

    
216
        public void dispose() {
217
        }
218
        
219
        public int getMode() {
220
                return DataServerExplorer.MODE_RASTER;
221
        }
222

    
223
}