org.kie.internal.io

## Class ResourceFactory

- java.lang.Object
- - org.kie.internal.io.ResourceFactory

-     public class ResourceFactory
      extends Object

  Convenience Factory to provide Resource implementations for the desired IO resource.

       KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
       kbuilder.add( ResourceFactory.newUrlResource( "htp://www.domain.org/myProcess.bpmn2" ),
                     ResourceType.BPMN2 );

       KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
       kbuilder.add( ResourceFactory.newClassPathResource( "htp://www.domain.org/myrules.drl", getClass() ),
                     ResourceType.DRL );

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ResourceChangeNotifier` | `getResourceChangeNotifierService()` A Service that can be started, to provide notifications of changed Resources.
    `static ResourceChangeScanner` | `getResourceChangeScannerService()` As service, that scans the disk for changes, this acts as a Monitor for the Notifer service.
    `static org.kie.api.io.Resource` | `newByteArrayResource(byte[] bytes)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path, Class clazz)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path, ClassLoader classLoader)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path, String encoding)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path, String encoding, Class clazz)`
    `static org.kie.api.io.Resource` | `newClassPathResource(String path, String encoding, ClassLoader classLoader)`
    `static org.kie.api.io.Resource` | `newDescrResource(KnowledgeDescr descr)`
    `static org.kie.api.io.Resource` | `newFileResource(File file)`
    `static org.kie.api.io.Resource` | `newFileResource(String fileName)`
    `static org.kie.api.io.Resource` | `newInputStreamResource(InputStream stream)`
    `static org.kie.api.io.Resource` | `newInputStreamResource(InputStream stream, String encoding)`
    `static org.kie.api.io.Resource` | `newReaderResource(Reader reader)`
    `static org.kie.api.io.Resource` | `newReaderResource(Reader reader, String encoding)`
    `static org.kie.api.io.Resource` | `newUrlResource(String path)`
    `static org.kie.api.io.Resource` | `newUrlResource(URL url)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceFactory

          public ResourceFactory()

  - ### Method Detail

    - #### getResourceChangeNotifierService

          public static ResourceChangeNotifier getResourceChangeNotifierService()

      A Service that can be started, to provide notifications of changed Resources.
      Returns:

    - #### getResourceChangeScannerService

          public static ResourceChangeScanner getResourceChangeScannerService()

      As service, that scans the disk for changes, this acts as a Monitor for the Notifer service.
      Returns:

    - #### newUrlResource

          public static org.kie.api.io.Resource newUrlResource(URL url)

    - #### newUrlResource

          public static org.kie.api.io.Resource newUrlResource(String path)

    - #### newFileResource

          public static org.kie.api.io.Resource newFileResource(File file)

    - #### newFileResource

          public static org.kie.api.io.Resource newFileResource(String fileName)

    - #### newByteArrayResource

          public static org.kie.api.io.Resource newByteArrayResource(byte[] bytes)

    - #### newInputStreamResource

          public static org.kie.api.io.Resource newInputStreamResource(InputStream stream)

    - #### newInputStreamResource

          public static org.kie.api.io.Resource newInputStreamResource(InputStream stream,
                                                                       String encoding)

    - #### newReaderResource

          public static org.kie.api.io.Resource newReaderResource(Reader reader)

    - #### newReaderResource

          public static org.kie.api.io.Resource newReaderResource(Reader reader,
                                                                  String encoding)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path,
                                                                     Class clazz)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path,
                                                                     ClassLoader classLoader)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path,
                                                                     String encoding)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path,
                                                                     String encoding,
                                                                     Class clazz)

    - #### newClassPathResource

          public static org.kie.api.io.Resource newClassPathResource(String path,
                                                                     String encoding,
                                                                     ClassLoader classLoader)

    - #### newDescrResource

          public static org.kie.api.io.Resource newDescrResource(KnowledgeDescr descr)

Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.