Revision 28113 branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/gpe/GPELibraryExtension.java

View differences:

GPELibraryExtension.java
27 27
 
28 28
package org.gvsig.gpe;
29 29

  
30
import java.io.File;
31
import java.io.FileNotFoundException;
32

  
33 30
import org.gvsig.fmap.dal.store.gpe.GPELibrary;
34 31

  
35
import com.iver.andami.messages.NotificationManager;
36 32
import com.iver.andami.plugins.Extension;
37 33

  
38 34
/**
......
40 36
 */
41 37
public class GPELibraryExtension extends Extension{
42 38
	private GPELibrary lib = null;
43
	private String parsersFile = "gvSIG" + File.separatorChar + "extensiones" + File.separatorChar + 
44
	"org.gvsig.gpe" + File.separatorChar + "parser.properties";
45
	
39
		
46 40
	/* (non-Javadoc)
47 41
	 * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
48 42
	 */
......
55 49
	 * @see com.iver.andami.plugins.IExtension#initialize()
56 50
	 */
57 51
	public void initialize() {
58
		File file = new File(parsersFile);
59
		if (!file.exists()){
60
			NotificationManager.addWarning("File not found",
61
					new FileNotFoundException());
62
			return;
63
		}
64
		try {
65
			GPERegister.addParsersFile(file);
66
		} catch (Exception e) {
67
			NotificationManager.addWarning("GPE parsers file not found",
68
					new FileNotFoundException());
69
		}
70
		
71 52
		lib = new GPELibrary();
72 53
		lib.initialize();		
73 54
	}	

Also available in: Unified diff