Package org.kie.internal.io

## Class ResourceFactory

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

-     public class ResourceFactory
      extends java.lang.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 | Description
    --- | ---
    `ResourceFactory()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static org.kie.api.io.Resource` | `newByteArrayResource​(byte[] bytes)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path, java.lang.Class clazz)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path, java.lang.ClassLoader classLoader)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path, java.lang.String encoding)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path, java.lang.String encoding, java.lang.Class clazz)` |
    `static org.kie.api.io.Resource` | `newClassPathResource​(java.lang.String path, java.lang.String encoding, java.lang.ClassLoader classLoader)` |
    `static org.kie.api.io.Resource` | `newDescrResource​(KnowledgeDescr descr)` |
    `static org.kie.api.io.Resource` | `newFileResource​(java.io.File file)` |
    `static org.kie.api.io.Resource` | `newFileResource​(java.lang.String fileName)` |
    `static org.kie.api.io.Resource` | `newInputStreamResource​(java.io.InputStream stream)` |
    `static org.kie.api.io.Resource` | `newInputStreamResource​(java.io.InputStream stream, java.lang.String encoding)` |
    `static org.kie.api.io.Resource` | `newReaderResource​(java.io.Reader reader)` |
    `static org.kie.api.io.Resource` | `newReaderResource​(java.io.Reader reader, java.lang.String encoding)` |

    - ### 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

    - #### newFileResource

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

    - #### newFileResource

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

    - #### newByteArrayResource

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

    - #### newInputStreamResource

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

    - #### newInputStreamResource

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

    - #### newReaderResource

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

    - #### newReaderResource

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

    - #### newClassPathResource

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

    - #### newClassPathResource

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

    - #### newClassPathResource

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

    - #### newClassPathResource

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

    - #### newClassPathResource

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

    - #### newClassPathResource

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

    - #### newDescrResource

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