Class MemoryFileSystem
- java.lang.Object
-
- org.drools.compiler.compiler.io.memory.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 Summary
Constructors Constructor Description MemoryFileSystem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MemoryFileSystem
clone()
int
copyFolder(Folder srcFolder, MemoryFileSystem trgMfs, Folder trgFolder, java.lang.String... filters)
void
createFolder(MemoryFolder folder)
boolean
equals(java.lang.Object obj)
boolean
existsFile(org.drools.util.PortablePath path)
boolean
existsFolder(MemoryFolder folder)
boolean
existsFolder(org.drools.util.PortablePath path)
java.lang.String
findPomProperties()
byte[]
getBytes(org.drools.util.PortablePath resourcePath)
File
getFile(org.drools.util.PortablePath path)
byte[]
getFileContents(MemoryFile file)
java.util.Collection<org.drools.util.PortablePath>
getFilePaths()
Folder
getFolder(org.drools.util.PortablePath path)
java.util.Map<org.drools.util.PortablePath,byte[]>
getMap()
java.util.Set<? extends FileSystemItem>
getMembers(Folder folder)
java.util.Collection<java.lang.String>
getModifiedResourcesSinceLastMark()
org.drools.io.InternalResource
getResource(MemoryFile file)
org.drools.io.InternalResource
getResource(org.drools.util.PortablePath resourcePath)
Folder
getRootFolder()
int
hashCode()
boolean
isAvailable(org.drools.util.PortablePath resourcePath)
void
mark()
java.lang.ClassLoader
memoryClassLoader(java.lang.ClassLoader parent)
void
printFs(java.io.PrintStream out)
void
printFs(Folder f, java.io.PrintStream out)
byte[]
read(org.drools.util.PortablePath resourcePath)
static MemoryFileSystem
readFromJar(byte[] jarFile)
static MemoryFileSystem
readFromJar(java.io.File jarFile)
static MemoryFileSystem
readFromJar(java.io.InputStream jarFile)
void
remove(java.util.Set<FileSystemItem> members)
boolean
remove(File file)
boolean
remove(Folder folder)
void
remove(org.drools.util.PortablePath resourcePath)
void
setFileContents(MemoryFile file, byte[] contents)
void
setFileContents(MemoryFile file, org.kie.api.io.Resource resource)
java.lang.String
toString()
void
write(org.drools.util.PortablePath resourcePath, byte[] pResourceData)
void
write(org.drools.util.PortablePath resourcePath, byte[] pResourceData, boolean createFolder)
void
write(org.drools.util.PortablePath resourcePath, org.kie.api.io.Resource resource)
void
write(org.drools.util.PortablePath resourcePath, org.kie.api.io.Resource resource, boolean createFolder)
byte[]
writeAsBytes()
void
writeAsFs(java.io.File file)
void
writeAsFs(Folder f, java.io.File file1)
java.io.File
writeAsJar(java.io.File folder, java.lang.String jarName)
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.compiler.compiler.io.FileSystem
getFile, getFolder
-
-
-
-
Method Detail
-
getRootFolder
public Folder getRootFolder()
- Specified by:
getRootFolder
in interfaceFileSystem
-
getFilePaths
public java.util.Collection<org.drools.util.PortablePath> getFilePaths()
- Specified by:
getFilePaths
in interfaceorg.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 interfaceFileSystem
-
getFolder
public Folder getFolder(org.drools.util.PortablePath path)
- Specified by:
getFolder
in interfaceFileSystem
-
getMembers
public java.util.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 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 interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getModifiedResourcesSinceLastMark
public java.util.Collection<java.lang.String> getModifiedResourcesSinceLastMark()
- Specified by:
getModifiedResourcesSinceLastMark
in interfaceorg.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 boolean remove(Folder folder)
- Specified by:
remove
in interfaceFileSystem
-
remove
public void remove(java.util.Set<FileSystemItem> members)
-
remove
public boolean remove(File file)
- Specified by:
remove
in interfaceFileSystem
-
copyFolder
public int copyFolder(Folder srcFolder, MemoryFileSystem trgMfs, Folder trgFolder, java.lang.String... filters)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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 interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getBytes
public byte[] getBytes(org.drools.util.PortablePath resourcePath)
- Specified by:
getBytes
in interfaceorg.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 interfaceorg.kie.memorycompiler.resources.ResourceStore
-
write
public void write(org.drools.util.PortablePath resourcePath, byte[] pResourceData, boolean createFolder)
- Specified by:
write
in interfaceorg.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 interfaceorg.kie.memorycompiler.resources.ResourceStore
-
remove
public void remove(org.drools.util.PortablePath resourcePath)
- Specified by:
remove
in interfaceorg.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(byte[] jarFile)
-
readFromJar
public static MemoryFileSystem readFromJar(java.io.InputStream jarFile)
-
findPomProperties
public java.lang.String findPomProperties()
-
clone
public MemoryFileSystem clone()
- Overrides:
clone
in classjava.lang.Object
-
memoryClassLoader
public java.lang.ClassLoader memoryClassLoader(java.lang.ClassLoader parent)
-
-