svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.file / org.gvsig.fmap.dal.file.lib / src / main / java / org / gvsig / fmap / dal / DALFileLibrary.java @ 44276
History | View | Annotate | Download (2.67 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
9 |
* version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
14 |
* details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License along with
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.fmap.dal; |
24 |
|
25 |
import org.gvsig.fmap.dal.resource.file.FileResource; |
26 |
import org.gvsig.fmap.dal.resource.file.FileResourceParameters; |
27 |
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices; |
28 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
29 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerFactory; |
30 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.DefaultFilesystemServerExplorerManager; |
31 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
32 |
import org.gvsig.tools.library.AbstractLibrary; |
33 |
import org.gvsig.tools.library.LibraryException; |
34 |
|
35 |
public class DALFileLibrary extends AbstractLibrary { |
36 |
|
37 |
@Override
|
38 |
public void doRegistration() { |
39 |
registerAsServiceOf(DALLibrary.class); |
40 |
} |
41 |
|
42 |
@Override
|
43 |
protected void doInitialize() throws LibraryException { |
44 |
} |
45 |
|
46 |
@Override
|
47 |
protected void doPostInitialize() throws LibraryException { |
48 |
DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager(); |
49 |
|
50 |
ResourceManagerProviderServices resman = (ResourceManagerProviderServices) DALLocator.getResourceManager(); |
51 |
|
52 |
if (!resman.getResourceProviders().contains(FileResource.NAME)) {
|
53 |
resman.register(FileResource.NAME, FileResource.DESCRIPTION, |
54 |
FileResource.class, FileResourceParameters.class); |
55 |
} |
56 |
|
57 |
if (!dataman.getServerExplorerRegister().exits(FilesystemServerExplorer.NAME)) {
|
58 |
dataman.registerServerExplorerFactory( |
59 |
new FilesystemServerExplorerFactory()
|
60 |
); |
61 |
DALFileLocator.registerFilesystemSeverExplorerManager( |
62 |
DefaultFilesystemServerExplorerManager.class |
63 |
); |
64 |
} |
65 |
} |
66 |
} |