Class MemoryFileSystem

  • All Implemented Interfaces:
    java.io.Serializable, FileSystem, org.kie.memorycompiler.resources.ResourceReader, org.kie.memorycompiler.resources.ResourceStore

    public class MemoryFileSystem
    extends java.lang.Object
    implements FileSystem, org.kie.memorycompiler.resources.ResourceReader, java.io.Serializable, org.kie.memorycompiler.resources.ResourceStore
    See Also:
    Serialized Form
    • Constructor Detail

      • MemoryFileSystem

        public MemoryFileSystem()
    • Method Detail

      • getFilePaths

        public java.util.Collection<org.drools.util.PortablePath> getFilePaths()
        Specified by:
        getFilePaths in interface org.kie.memorycompiler.resources.ResourceReader
      • getMap

        public java.util.Map<org.drools.util.PortablePath,​byte[]> getMap()
      • getFile

        public File getFile​(org.drools.util.PortablePath path)
        Specified by:
        getFile in interface FileSystem
      • getFolder

        public Folder getFolder​(org.drools.util.PortablePath path)
        Specified by:
        getFolder in interface FileSystem
      • getFileContents

        public byte[] getFileContents​(MemoryFile file)
      • getResource

        public org.drools.io.InternalResource getResource​(MemoryFile file)
      • setFileContents

        public void setFileContents​(MemoryFile file,
                                    byte[] contents)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • setFileContents

        public void setFileContents​(MemoryFile file,
                                    org.kie.api.io.Resource resource)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • mark

        public void mark()
        Specified by:
        mark in interface org.kie.memorycompiler.resources.ResourceReader
      • getModifiedResourcesSinceLastMark

        public java.util.Collection<java.lang.String> getModifiedResourcesSinceLastMark()
        Specified by:
        getModifiedResourcesSinceLastMark in interface org.kie.memorycompiler.resources.ResourceReader
      • existsFolder

        public boolean existsFolder​(MemoryFolder folder)
      • existsFolder

        public boolean existsFolder​(org.drools.util.PortablePath path)
      • existsFile

        public boolean existsFile​(org.drools.util.PortablePath path)
      • createFolder

        public void createFolder​(MemoryFolder folder)
      • remove

        public void remove​(java.util.Set<FileSystemItem> members)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • printFs

        public void printFs​(java.io.PrintStream out)
      • printFs

        public void printFs​(Folder f,
                            java.io.PrintStream out)
      • isAvailable

        public boolean isAvailable​(org.drools.util.PortablePath resourcePath)
        Specified by:
        isAvailable in interface org.kie.memorycompiler.resources.ResourceReader
      • getBytes

        public byte[] getBytes​(org.drools.util.PortablePath resourcePath)
        Specified by:
        getBytes in interface org.kie.memorycompiler.resources.ResourceReader
      • getResource

        public org.drools.io.InternalResource getResource​(org.drools.util.PortablePath resourcePath)
      • write

        public void write​(org.drools.util.PortablePath resourcePath,
                          byte[] pResourceData)
        Specified by:
        write in interface org.kie.memorycompiler.resources.ResourceStore
      • write

        public void write​(org.drools.util.PortablePath resourcePath,
                          byte[] pResourceData,
                          boolean createFolder)
        Specified by:
        write in interface org.kie.memorycompiler.resources.ResourceStore
      • write

        public void write​(org.drools.util.PortablePath resourcePath,
                          org.kie.api.io.Resource resource)
      • write

        public void write​(org.drools.util.PortablePath resourcePath,
                          org.kie.api.io.Resource resource,
                          boolean createFolder)
      • read

        public byte[] read​(org.drools.util.PortablePath resourcePath)
        Specified by:
        read in interface org.kie.memorycompiler.resources.ResourceStore
      • remove

        public void remove​(org.drools.util.PortablePath resourcePath)
        Specified by:
        remove in interface org.kie.memorycompiler.resources.ResourceStore
      • writeAsBytes

        public byte[] writeAsBytes()
      • writeAsJar

        public java.io.File writeAsJar​(java.io.File folder,
                                       java.lang.String jarName)
      • writeAsFs

        public void writeAsFs​(java.io.File file)
      • writeAsFs

        public void writeAsFs​(Folder f,
                              java.io.File file1)
      • readFromJar

        public static MemoryFileSystem readFromJar​(java.io.File jarFile)
      • readFromJar

        public static MemoryFileSystem readFromJar​(java.io.InputStream jarFile)
      • findPomProperties

        public java.lang.String findPomProperties()
      • clone

        public MemoryFileSystem clone()
        Overrides:
        clone in class java.lang.Object
      • memoryClassLoader

        public java.lang.ClassLoader memoryClassLoader​(java.lang.ClassLoader parent)