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 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
5 | *
|
||
6 | 43020 | jjdelcerro | * 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 | 40559 | jjdelcerro | *
|
11 | 43020 | jjdelcerro | * 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 | 40559 | jjdelcerro | *
|
16 | 43020 | jjdelcerro | * 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 | 40559 | jjdelcerro | *
|
20 | 43020 | jjdelcerro | * For any additional information, do not hesitate to contact us at info AT
|
21 | * gvsig.com, or visit our website www.gvsig.com.
|
||
22 | 40559 | jjdelcerro | */
|
23 | 40435 | jjdelcerro | 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 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerFactory; |
30 | 40435 | jjdelcerro | 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 | 43020 | jjdelcerro | @Override
|
38 | 40435 | jjdelcerro | public void doRegistration() { |
39 | registerAsServiceOf(DALLibrary.class); |
||
40 | } |
||
41 | |||
42 | 43020 | jjdelcerro | @Override
|
43 | protected void doInitialize() throws LibraryException { |
||
44 | } |
||
45 | 40435 | jjdelcerro | |
46 | 43020 | jjdelcerro | @Override
|
47 | protected void doPostInitialize() throws LibraryException { |
||
48 | DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager(); |
||
49 | 40435 | jjdelcerro | |
50 | 43020 | jjdelcerro | ResourceManagerProviderServices resman = (ResourceManagerProviderServices) DALLocator.getResourceManager(); |
51 | 40435 | jjdelcerro | |
52 | 43020 | jjdelcerro | if (!resman.getResourceProviders().contains(FileResource.NAME)) {
|
53 | resman.register(FileResource.NAME, FileResource.DESCRIPTION, |
||
54 | FileResource.class, FileResourceParameters.class); |
||
55 | } |
||
56 | 40435 | jjdelcerro | |
57 | 43020 | jjdelcerro | if (!dataman.getServerExplorerRegister().exits(FilesystemServerExplorer.NAME)) {
|
58 | dataman.registerServerExplorerFactory( |
||
59 | new FilesystemServerExplorerFactory()
|
||
60 | ); |
||
61 | DALFileLocator.registerFilesystemSeverExplorerManager( |
||
62 | DefaultFilesystemServerExplorerManager.class |
||
63 | ); |
||
64 | } |
||
65 | } |
||
66 | 40767 | jjdelcerro | } |