Package 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 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(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)
-
-
-
Method Detail
-
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)
-
-