![]() |
|
|
|
#1 |
|
hi,
i have a jar file with 2 reosources, when i use the reosources in jar file it's all ok. If i import the file jar as library and use it in a new file Prova i recive the following message: ERRORE: '/home/gianni/workspace/Prova/file:/home/gianni/JfuzzyLogicFML.jar!/net/sourceforge/jFuzzyLogic/fml2fcl.xsl (No such file or directory)'. i have duplicate path and i don't get resources right.... how can do to work right? public class Resources { this is the class that manage resources; public enum ResourceName{ fmlSchema, xslt, } /** * @uml.property name="properties" */ private static final String resourceName[] = new String[]{ "fmlSchema.xsd", "fml2fcl.xsl" }; /** * @uml.property name="singleton" */ private static Resources singleton; /** * @throws Exception */ public static Resources getInstance() throws Exception { if (singleton == null) { synchronized (Resources.class) { if (singleton == null) { singleton = new Resources(); } } } return singleton; } /** * Constructor * * @throws Exception */ private Resources(){ mapResources = new HashMap<ResourceName, File>(); } Map<ResourceName, File> mapResources; public File getResource(ResourceName name){ File file; file = mapResources.get(name); if( file == null ){ file = new File( getClass().getResource(resourceName[name.ordinal()]).getPath()); mapResources.put(name, file); } return file; } } and here i s where i use it: public static FIS loadFML(String fmlFilePath, boolean verbose) throws SAXException { FMLValidator validator = new FMLValidator(); File xml = new File(fmlFilePath); File fmlSchema = resources.getResource(Resources.ResourceName.fmlSc hema); File xslt = resources.getResource(Resources.ResourceName.xslt) ; validator.validate( xml , fmlSchema.getPath()); String fclDefinition = FML2FCLTransformation.transform( xml , xslt); System.out.print(xslt); return createFromString(fclDefinition, verbose); } daniele |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Great dump resources! | Starry | A+ Certification | 0 | 07-31-2007 04:09 PM |
| 74-134 Exam Books & Resources | Yasin | MCTS | 2 | 07-13-2007 01:40 PM |
| Legacy Devices and Reserving Resources Question | Bloke_in_a_box | A+ Certification | 1 | 05-04-2004 06:52 PM |
| OT: Free Learning Resources | Dom | A+ Certification | 0 | 09-12-2003 10:51 AM |
| a+ files and resources | Dave_Dave | A+ Certification | 0 | 08-02-2003 06:30 PM |