Class MemoryFileSystem

java.lang.Object
org.drools.compiler.compiler.io.memory.MemoryFileSystem
All Implemented Interfaces:
Serializable, FileSystem, ResourceReader, ResourceStore

public class MemoryFileSystem extends Object implements FileSystem, ResourceReader, Serializable, ResourceStore
See Also:
  • Constructor Details

    • MemoryFileSystem

      public MemoryFileSystem()
  • Method Details

    • getRootFolder

      public Folder getRootFolder()
      Specified by:
      getRootFolder in interface FileSystem
    • getFilePaths

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

      public 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
    • getMembers

      public Set<? extends FileSystemItem> getMembers(Folder folder)
    • getFileContents

      public byte[] getFileContents(MemoryFile file)
    • getResource

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

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

      public void setFileContents(MemoryFile file, Resource resource) throws IOException
      Throws:
      IOException
    • mark

      public void mark()
      Specified by:
      mark in interface ResourceReader
    • getModifiedResourcesSinceLastMark

      public Collection<String> getModifiedResourcesSinceLastMark()
      Specified by:
      getModifiedResourcesSinceLastMark in interface 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 boolean remove(Folder folder)
      Specified by:
      remove in interface FileSystem
    • remove

      public void remove(Set<FileSystemItem> members)
    • remove

      public boolean remove(File file)
      Specified by:
      remove in interface FileSystem
    • copyFolder

      public int copyFolder(Folder srcFolder, MemoryFileSystem trgMfs, Folder trgFolder, String... filters)
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

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

      public void printFs(PrintStream out)
    • printFs

      public void printFs(Folder f, PrintStream out)
    • isAvailable

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

      public byte[] getBytes(org.drools.util.PortablePath resourcePath)
      Specified by:
      getBytes in interface 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 ResourceStore
    • write

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

      public void write(org.drools.util.PortablePath resourcePath, Resource resource)
    • write

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

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

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

      public byte[] writeAsBytes()
    • writeAsJar

      public File writeAsJar(File folder, String jarName)
    • writeAsFs

      public void writeAsFs(File file)
    • writeAsFs

      public void writeAsFs(Folder f, File file1)
    • readFromJar

      public static MemoryFileSystem readFromJar(File jarFile)
    • readFromJar

      public static MemoryFileSystem readFromJar(byte[] jarFile)
    • readFromJar

      public static MemoryFileSystem readFromJar(InputStream jarFile)
    • findPomProperties

      public String findPomProperties()
    • clone

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

      public ClassLoader memoryClassLoader(ClassLoader parent)