Package org.drools.io.internal

Examples of org.drools.io.internal.InternalResource


            ChangeSet changeSet = reader.read( resourceReader );
            if (changeSet == null) {
                // @TODO should log an error
            }
            for (Resource nestedResource : changeSet.getResourcesAdded()) {
                InternalResource iNestedResourceResource = (InternalResource) nestedResource;
                if (iNestedResourceResource.isDirectory()) {
                    for (Resource childResource : iNestedResourceResource.listResources()) {
                        if (( (InternalResource) childResource ).isDirectory()) {
                            continue; // ignore sub directories
                        }
                        ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                        addKnowledgeResource( childResource,
                                              iNestedResourceResource.getResourceType(),
                                              iNestedResourceResource.getConfiguration() );
                    }
                } else {
                    addKnowledgeResource( iNestedResourceResource,
                                          iNestedResourceResource.getResourceType(),
                                          iNestedResourceResource.getConfiguration() );
                }
            }
        } finally {
            if (resourceReader != null) {
                resourceReader.close();
View Full Code Here


                ChangeSet changeSet = reader.read( resource.getReader() );
                if (changeSet == null) {
                    // @TODO should log an error
                }
                for (Resource nestedResource : changeSet.getResourcesAdded()) {
                    InternalResource iNestedResourceResource = (InternalResource) nestedResource;
                    if (iNestedResourceResource.isDirectory()) {
                        this.resourceDirectories.add( iNestedResourceResource );
                        for (Resource childResource : iNestedResourceResource.listResources()) {
                            if (( (InternalResource) childResource ).isDirectory()) {
                                continue; // ignore sub directories
                            }
                            ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                            addKnowledgeResource( childResource,
                                                  iNestedResourceResource.getResourceType(),
                                                  iNestedResourceResource.getConfiguration() );
                        }
                    } else {
                        addKnowledgeResource( iNestedResourceResource,
                                              iNestedResourceResource.getResourceType(),
                                              iNestedResourceResource.getConfiguration() );
                    }
                }
            } else if (ResourceType.XSD.equals( type )) {
                JaxbConfigurationImpl confImpl = (JaxbConfigurationImpl) configuration;
                String[] classes = DroolsJaxbHelperProviderImpl.addXsdModel( resource,
View Full Code Here

        ChangeSet changeSet = reader.read( resource.getReader() );
        if (changeSet == null) {
            // @TODO should log an error
        }
        for (Resource nestedResource : changeSet.getResourcesAdded()) {
            InternalResource iNestedResourceResource = (InternalResource) nestedResource;
            if (iNestedResourceResource.isDirectory()) {
                for (Resource childResource : iNestedResourceResource.listResources()) {
                    if (( (InternalResource) childResource ).isDirectory()) {
                        continue; // ignore sub directories
                    }
                    ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                    addKnowledgeResource( childResource,
                                          iNestedResourceResource.getResourceType(),
                                          iNestedResourceResource.getConfiguration() );
                }
            } else {
                addKnowledgeResource( iNestedResourceResource,
                                      iNestedResourceResource.getResourceType(),
                                      iNestedResourceResource.getConfiguration() );
            }
        }
    }
View Full Code Here

        ChangeSet changeSet = reader.read( resource.getReader() );
        if (changeSet == null) {
            // @TODO should log an error
        }
        for (Resource nestedResource : changeSet.getResourcesAdded()) {
            InternalResource iNestedResourceResource = (InternalResource) nestedResource;
            if (iNestedResourceResource.isDirectory()) {
                for (Resource childResource : iNestedResourceResource.listResources()) {
                    if (( (InternalResource) childResource ).isDirectory()) {
                        continue; // ignore sub directories
                    }
                    ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                    addKnowledgeResource( childResource,
                                          iNestedResourceResource.getResourceType(),
                                          iNestedResourceResource.getConfiguration() );
                }
            } else {
                addKnowledgeResource( iNestedResourceResource,
                                      iNestedResourceResource.getResourceType(),
                                      iNestedResourceResource.getConfiguration() );
            }
        }
    }
View Full Code Here

                }
                public int[] getLines() { return new int[ 0 ]; }
            } );
        }
        for (Resource nestedResource : changeSet.getResourcesAdded()) {
            InternalResource iNestedResourceResource = (InternalResource) nestedResource;
            if (iNestedResourceResource.isDirectory()) {
                for (Resource childResource : iNestedResourceResource.listResources()) {
                    if (( (InternalResource) childResource ).isDirectory()) {
                        continue; // ignore sub directories
                    }
                    ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                    addKnowledgeResource( childResource,
                            iNestedResourceResource.getResourceType(),
                            iNestedResourceResource.getConfiguration() );
                }
            } else {
                addKnowledgeResource( iNestedResourceResource,
                        iNestedResourceResource.getResourceType(),
                        iNestedResourceResource.getConfiguration() );
            }
        }
    }
View Full Code Here

            return type.getTypeClassName();
        }
    }

    public void registerBuildResource( final Resource resource, ResourceType type ) {
        InternalResource ires = (InternalResource) resource;
        if ( ires.getResourceType() == null ) {
            ires.setResourceType( type );
        } else if ( ires.getResourceType() != type ) {
            this.results.add( new ResourceTypeDeclarationWarning( resource, ires.getResourceType(), type ) );
        }
        if ( ResourceType.CHANGE_SET == type ) {
            try {
                ChangeSet changeSet = parseChangeSet( resource );
                List<Resource> resources = new ArrayList<Resource>(  );
View Full Code Here

            ChangeSet changeSet = reader.read( resourceReader );
            if (changeSet == null) {
                // @TODO should log an error
            }
            for (Resource nestedResource : changeSet.getResourcesAdded()) {
                InternalResource iNestedResourceResource = (InternalResource) nestedResource;
                if (iNestedResourceResource.isDirectory()) {
                    for (Resource childResource : iNestedResourceResource.listResources()) {
                        if (( (InternalResource) childResource ).isDirectory()) {
                            continue; // ignore sub directories
                        }
                        ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                        addKnowledgeResource( childResource,
                                              iNestedResourceResource.getResourceType(),
                                              iNestedResourceResource.getConfiguration() );
                    }
                } else {
                    addKnowledgeResource( iNestedResourceResource,
                                          iNestedResourceResource.getResourceType(),
                                          iNestedResourceResource.getConfiguration() );
                }
            }
        } finally {
            if (resourceReader != null) {
                resourceReader.close();
View Full Code Here

            ChangeSet changeSet = reader.read( resourceReader );
            if (changeSet == null) {
                // @TODO should log an error
            }
            for (Resource nestedResource : changeSet.getResourcesAdded()) {
                InternalResource iNestedResourceResource = (InternalResource) nestedResource;
                if (iNestedResourceResource.isDirectory()) {
                    for (Resource childResource : iNestedResourceResource.listResources()) {
                        if (( (InternalResource) childResource ).isDirectory()) {
                            continue; // ignore sub directories
                        }
                        ( (InternalResource) childResource ).setResourceType( iNestedResourceResource.getResourceType() );
                        addKnowledgeResource( childResource,
                                              iNestedResourceResource.getResourceType(),
                                              iNestedResourceResource.getConfiguration() );
                    }
                } else {
                    addKnowledgeResource( iNestedResourceResource,
                                          iNestedResourceResource.getResourceType(),
                                          iNestedResourceResource.getConfiguration() );
                }
            }
        } finally {
            if (resourceReader != null) {
                resourceReader.close();
View Full Code Here

       
        emptyAttributeCheck( localName,
                             "type",
                             type,
                             parser );       
        InternalResource resource = null;
       
        if ( src.trim().startsWith( "classpath:" ) ) {
            resource = new ClassPathResource( src.substring( src.indexOf( ':' ) + 1 ) );
        } else {
            resource = new UrlResource( src );
            ((UrlResource)resource).setBasicAuthentication(basicAuthentication);
            ((UrlResource)resource).setUsername(username);
            ((UrlResource)resource).setPassword(password);          
        }
       
        resource.setResourceType( ResourceType.getResourceType( type ) );
       
        return resource;
    }
View Full Code Here

    public Object end(String uri,
                      String localName,
                      ExtensibleXmlParser parser) throws SAXException {
        final Element element = parser.endElementBuilder();
        final InternalResource resource = (InternalResource) parser.getParent();
        ResourceConfiguration dtConf = (ResourceConfiguration) parser.getCurrent();
        resource.setConfiguration( dtConf );
       
        return dtConf;
    }
View Full Code Here

TOP

Related Classes of org.drools.io.internal.InternalResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.